Ajay Saini

Ajay Saini

  • 1.5k
  • 183
  • 23.1k

Crystal report export PDF is not supporting all HTML symbols

Nov 5 2018 3:58 AM

I am using Crystal Reports to Export PDF file. There are couple of fields in the database which contains HTML symbols to generate symbols.

I am exporting PDF from C# to export PDF. The problem is that few HTML symbols like "ampersand #8728;" are not converting into the real HTML which is degree symbol in our case, they are either nothing show or showing as square boxes. Few codes like "ampersand #0176;" is working properly.

However the same code (ampersand #8728;) if i tried to export in MS Word format then it show the correct symbols which i am expecting with PDF too. Not sure why some of them are supported and some of not.

 

 
  
 
 
Following are the part of the codecode to export PDF.

ReportDocument rptdoc = rptdoc = new ReportDocument();
rptdoc.Load(HttpContext.Current.Server.MapPath("~\\Reports\\TestRPT.rpt"));
rptdoc.SetDataSource(myDataTable);
ExportOptions exportOpts1 = rptdoc.ExportOptions;
rptdoc.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
rptdoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
rptdoc.ExportOptions.DestinationOptions = new DiskFileDestinationOptions();
((DiskFileDestinationOptions)rptdoc.ExportOptions.DestinationOptions).DiskFileName = HttpContext.Current.Server.MapPath("~\\TempPdf\\" + filenmae + ".pdf");
rptdoc.Export();
rptdoc.Dispose();
rptdoc.Close();
rptdoc = new ReportDocument();  

Answers (1)