Hi,
I check the "exportExcel" method in our pro API. And also check the export demo. Base on the demo and API, and want to know how the grid pass the data to background.
In the demo I saw this code (ASP.NET):
$("#grid_export").pqGrid("exportExcel", { url: "/pro/demos/excel", sheetName: "pqGrid sheet" });
And the background
[HttpPost, ValidateInput(false)]
public String excel(String extension, String excel)
{
if (extension != "csv" && extension != "xml")
{
throw new Exception("Unsupported extension");
}
String filename = "pqGrid." + extension;
System.IO.File.WriteAllText(Server.MapPath("~") + "\\" + filename, excel);
return filename;
}
[HttpGet]
public FileContentResult excel(String filename)
{
String path = Server.MapPath("~") + "\\" + filename;
String contents = System.IO.File.ReadAllText(path);
if(filename.EndsWith(".csv")){
return File(new System.Text.UTF8Encoding().GetBytes(contents), "text/csv", filename);
}
else if(filename.EndsWith(".xml")){
return File(new System.Text.UTF8Encoding().GetBytes(contents), "text/xml", filename);
}
else{
throw new Exception("unknown extension");
}
}
And my platform is Salesforce. So I want to know how these grid data pass to background, then I can achieve it in Salesforce.
Thank you!