Posted 27 July 2021, 2:57 am EST
I used ActiveReport 6.2.3681.0 in a ASP.Net/C# Web application. For PDF export I used following code :
[b]DataDynamics.ActiveReports.Export.Pdf.PdfExport pdfExportObject = new DataDynamics.ActiveReports.Export.Pdf.PdfExport();
pdfExportObject.ExportBookmarks = true;
pdfExportObject.Options.Title = exportFileName;
pdfExportObject.Export(DataDynamics.ActiveReports.ActiveReport.Document, exportPath + “\” + exportFileName);[/b]
It is working fine in Internet Explorer but it is throwing error in EDGE/CHROME when the file name has COMMA.
I found this is a known issue specific to Chrome/EDGE specifically related to the Content-Disposition header. This is caused by the fact that chrome/edge doesn’t properly handle escaping of commas while Firefox, IE, etc. do.
In order to fix this we need to wrap the file name in response header with “Double Quotes”. E.g.-
Response.AddHeader(“Content-Disposition”, “attachment; filename="” + saveNm + “.pdf"”);
MY QUESTION IS, HOW SHOULD I DO THIS IN DataDynamics.ActiveReports.Export.Pdf.PdfExport ?