Click here to Skip to main content
Rate this: bad
good
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";
 
  try
  {
    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;
    }
    cryRpt.Export();
    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 23:23pm
jopima1.2K
Edited 6-Nov-10 23:44pm
JF201553.3K
v3
Rate this: bad
good
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.
  Permalink  
Comments
jopima at 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 at 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 at 12-Apr-13 14:36pm
   
+5 from me to compensate for unwarranted downvote.
IndifferentDisdain at 12-Apr-13 14:40pm
   
Much appreciated!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
IndifferentDisdain at 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 at 12-Apr-13 14:35pm
   
Yeah, doesn't make sense. +5 from me to compensate...
IndifferentDisdain at 12-Apr-13 14:44pm
   
Commented on the wrong comment of yours, so thanks again!

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 545
1 OriginalGriff 285
2 Shweta N Mishra 244
3 BillWoodruff 230
4 Mathew Soji 225
0 OriginalGriff 6,153
1 Sergey Alexandrovich Kryukov 5,758
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,735


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2014
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