Click here to Skip to main content
13,052,900 members (62,923 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";
 
  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 22:23pm
jopima1.4K
Updated 13-Jul-17 12:00pm
JF201555.4K
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 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
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
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
 
good
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.
  Permalink  
Comments
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Not sure if still going to be read by anyone, but here is our experienc:
- VS 2008 same problem as describe by others here. Calibri font.
- Migrated to Crystal reports for Visual Studio 2013 and up to SP 18, everything works fine with Calibri.
- Recently upgraded to SP 20 and the problem seems to be back again.
- Went back to SP 18 and problem has disappeared, seems to be SAP's typical regression, but might be wrong.
- Not sure if SP 19 would still work correctly
- Not sure if there's a fix like SP21, will search on that right now
- I've just checked SP19: instead of inserting an 'i' it inserts an 'f' after a 't'. Personally I liked the 'i' better, made everything sound like 'Itialain' :)

So ... Don't go past SP 18 and you'll be fine!
  Permalink  
v3
Comments
Kats2512 14-Jul-17 2:48am
   
and thanks for reopening a 7 year old post! that already has a solution that was accepted!
Member 13308952 14-Jul-17 4:45am
   
Yes very old post, but since it is happening TODAY again, I thought people with the problem might end up here, like I did.
Then about the "accepted solution": For a lot of people - like our customer - "NOT using Calibri", is simply NOT an acceptable solution.

Thanks for being an *** and get a life
Kats2512 14-Jul-17 4:47am
   
no need to be abusive and call names! account reported.
Member 13308952 14-Jul-17 4:50am
   
You are the one being abusive, you can report whatever you like. Your comment hasn't helped anyone.

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
Web01 | 2.8.170713.1 | Last Updated 13 Jul 2017
Copyright © CodeProject, 1999-2017
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