Click here to Skip to main content
12,405,868 members (44,487 online)
Rate this:
Please Sign up or sign in to vote.
I use Visual Studio 2005 with c# and windows forms. I managed to export crystal reports to pdf in code. But The exported pdf report has added characters. For Example it would display "Mathematics" as "Mathematcs" or
"History" as "Histtory" or "Subject" as "Subjecti"
It basically adds t to every word that has t in lower case. or appends i to it.

I have googled for any posible solution, applied crystal report 2005 hotfix. But the problem continues.

I am stuck. The sample code for export is pasted below

private void btnPrint_Click(object sender, EventArgs e)
  string _FileName = DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + ".pdf";
    ReportDocument cryRpt = new ReportDocument();
    cryRpt = (ReportDocument)crystalReportViewer1.ReportSource;
    ExportOptions exportOpts = new ExportOptions();
    exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
    exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
    ExportOptions CrExportOptions;
    DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
    PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
    CrDiskFileDestinationOptions.DiskFileName = ConfigurationManager.AppSettings.Get("PRINT_TEMP") + _FileName;
    CrExportOptions = cryRpt.ExportOptions;
      CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
      CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
      CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
      CrExportOptions.FormatOptions = CrFormatTypeOptions;
    System.Diagnostics.Process.Start(ConfigurationManager.AppSettings.Get("PRINT_TEMP") + _FileName);
  catch(Exception Ex)
    string msg = Ex.Message;
    MessageBox.Show("You Must Have a report viewable in the Report panel To print");
Posted 6-Nov-10 22:23pm
Updated 6-Nov-10 22:44pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I guess you have used unusual fonts for text fields, formulas, etc objects in crystal reports. So just verify the fonts in your reports. I have the same issue once upon a time & I verified the fonts for the objects & it was Calibri or something I think. So you need to install the font in production server or change the fonts for you objects in crystal reports with regular fonts like Arial, Tahoma, Verdana.
jopima 9-Nov-10 11:57am
Thanks for your response, Actually you are right. i am using calibri font. That behavior thou happened on my development machine before i took the system into production. when i test run it in production i was surprised that the reports come out without the strange characters added. that was my biggest panic point. let me follow that line of thought and see how far i go to fix it permanently. i don't intend to drop using calibri font.
IndifferentDisdain 12-Apr-13 14:42pm
I noticed the same issues; I think in my case it was due to having CR2008 on my dev machine, and just the runtime on my test server, so maybe installing CR2008 resolves it? Not sure, kind of confusing. I was able to change fonts, so I just went with that:)
H.Brydon 12-Apr-13 14:36pm
+5 from me to compensate for unwarranted downvote.
IndifferentDisdain 12-Apr-13 14:40pm
Much appreciated!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

IndifferentDisdain 12-Apr-13 10:39am
I'm curious why this was downvoted; anyone care to share? I literally went through this at work about a week ago.
H.Brydon 12-Apr-13 14:35pm
Yeah, doesn't make sense. +5 from me to compensate...
IndifferentDisdain 12-Apr-13 14:44pm
Commented on the wrong comment of yours, so thanks again!
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

It's a bug somehow in the PDF generation in combination with the Calibri font. The only solution i have is to use a different font.
CHill60 9-Feb-16 7:20am
Which is essentially what solution 1 said 5 years ago.
Please don't post additional solutions to old posts unless you have new information to add

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 9 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100