Hello All,
I am unable to print Unicode characters(chinese) in the Crystal report (.rpt) once loaded in page using asp.net(.aspx).
Using below code its working for Non-unicode characters , but not working for Unicode characters and even I updated crystal report(.rpt) to font setting to Arial Unicode from the report end.
My code converting to PDF :
cryRpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"\\**********\**\**\" + TextBox1.Text + "");
FileInfo fileinfo = new FileInfo(@"\\**********\**\**\" + TextBox1.Text + "");
Response.AddHeader("Content-Disposition", "inline;filenam=demo.pdf");
Response.ContentType = "application/pdf";
Response.WriteFile(fileinfo.FullName);
Suggest any thing need to update this code to work on Unicode characthers to dispaly in the report.
Currently I am getting square boxes in the Unicode code using above code.
Please help in this to fix this issue.
anand mPosted Mar 16, 2023, 8:16 AM
Hello Paul,
I am unable to get few of attributes on your code and I am using below itextsharp class version for this i am not getting few of issues
currently i am using Vs.net 2015
PdfDocument pdfDoc = new PdfDocument(new PdfReader(@"\\**********\**\**\" + TextBox1.Text + "")); (in this code PDFdocument is not getting constructor to declare here).
Please let me know which Itextsharp version to declare to gett all yourr code work.
itextsharp, Version=5.5.13.3(i am using this version).
Thanks for your help.
Jignesh KumarPosted Mar 16, 2023, 5:16 AM
Hello Anand,
Please refer this one,
https://social.msdn.microsoft.com/Forums/en-US/d8ba426a-8086-4eb2-8d5f-fd710fd305df/showing-unicode-characters-in-crystal-report?forum=aspcrystalreports
Tuhin PaulPosted Mar 16, 2023, 1:18 AM
Hello Anand,
The issue is with printing Unicode characters in Crystal report through ASP.NET.
To print Unicode characters in the Crystal report, you need to make sure that the appropriate font is installed on your system and that the font is specified in the Crystal report. Arial Unicode MS is a font that supports Unicode characters, but you need to make sure that it is installed on the system where the report is being generated and rendered. In your code, you are exporting the Crystal report to a PDF file and then displaying it in the browser. To ensure that the Unicode characters are displayed correctly, you can try setting the font of the exported PDF document to Arial Unicode MS. modify your code:
we are using iTextSharp library to load the exported PDF document and then set the font of the page to Arial Unicode MS. We are also replacing the default font with Arial Unicode MS for all text and form fields in the PDF document.