0
votes

I'm using c# to export a Crystal Reports file to PDF. If I preview the report in Crystal Reports (by manually adding the parameters) I see the report perfectly. When I use the c# code to export this to PDF the PDF doesn't show Japanese characters. I just get some squares. I'm using arial as font.

What am I doing wrong?

        ReportDocument cryRpt = new ReportDocument();

        cryRpt.Load(report);


        cryRpt.SetDatabaseLogon(sqluser, sqlpassword, sqlserver, company);

        ExportOptions CrExportOptions;
        DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
        PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();

        foreach (ReportDocument subrep in cryRpt.Subreports)
        {
            subrep.SetDatabaseLogon(sqluser, sqlpassword, sqlserver, company);
        }




        CrDiskFileDestinationOptions.DiskFileName = docname;
        CrExportOptions = cryRpt.ExportOptions;

        CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
        CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
        CrExportOptions.FormatOptions = CrFormatTypeOptions;

        cryRpt.Export();

        cryRpt.Close();
        cryRpt.Dispose();
        cryRpt = null;
1

1 Answers

0
votes

http://www.codeproject.com/Tips/749570/How-to-Export-Crystal-Report-in-Regional-Language

I am going to resolve Issue of Font Displaying Box or Junk While Exporting Crystal report which Is created In Regional Language Like Marathi, Hindi ,Arabic. Most Issue Is because of The font .

The Font Which We use while developing Report Should be there on Server

Where you are going to Deploy your application .

If font is not there then it will create Junk like Characters .

Tip: You Cannot use any font to develop Report you should use Unicode Font for it.

Main Step is install Font on Server or any Place Where you are Going to Deploy Application.

While export Crystal report in Language like English we do not get issue because

by Default that font is installed in your PC(Computer).

But While Developing Report In regional Language we face issues: