Print Page | Close Window

Calibri font inserts extra characters into PDF ver

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16962
Printed Date: 16 Apr 2025 at 7:15pm


Topic: Calibri font inserts extra characters into PDF ver
Posted By: nwthilina
Subject: Calibri font inserts extra characters into PDF ver
Date Posted: 04 Jul 2012 at 8:57pm
http://scn.sap.com/message/7207045#7207045 -

We've determined that the problem is due to the fact that we're using the Calibri font; if we use a different font, it works fine. Also, if the end-user copies text from the generated PDF and pastes it into another document, it renders the correct spelling. So for example if they copy "Scotiti" out of the PDF and paste it into Notepad, it shows "Scott" as it normally should.

The obvious solution would seem to be changing the font on all of our reports to something else, but unfortunately we have hundreds of reports scattered across a half-dozen sites, and we would rather not have to change each and every report.

For the sake of completeness, I updated the Adobe Reader on one of the trouble machines to 9.1, and the problem still occurs.

Any Solution for this ?




Replies:
Posted By: hilfy
Date Posted: 05 Jul 2012 at 3:39am
What version of Crystal are you using?  Do you have the latest service pack/fix pack for that version?
 
If that doesn't work, there is no way to resolve the issue other than changing the font.  If you can program (or have access to a programmer) in Java or Visual Studtio, you might be able to create a program that will do this update for you so that you don't have to manually update all of them.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: nwthilina
Date Posted: 05 Jul 2012 at 4:32pm
Crystal Report which is comming from Visual Studio 2008
Yes i have installed latest Service Pack,
 
This error is comming when you directly export from the Report viewer(Crystal Report Loading Pannel)
 
But When you export to Other Type (word or Excel) this error is not happening
 


Posted By: hilfy
Date Posted: 06 Jul 2012 at 2:49am
The .dll files for the exports are different based on the type of export, so you really can't compare them as they all use different code.  Unfortunately, I don't think you're going to be able to do anything about this except change the font. 
Since you're using VS 2008, you should be able to use the Crystal SDK to update the reports.  This has piqued my curiosity so I'm going to play with the code a bit and see if I can come up with a sample for you.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: hilfy
Date Posted: 06 Jul 2012 at 11:23am
Working in C# and using the ReportDocument object model, here's some sample code for changing fonts:
private void updateReport(ReportDocument doc)
{
  Font ft;
  foreach (Section sec in doc.ReportDefinition.Sections)
  {
    foreach (ReportObject obj in sec.ReportObjects)
    {
      if (obj.Kind == ReportObjectKind.FieldHeadingObject)
      {
        FieldHeadingObject fobj = (FieldHeadingObject)obj;
        ft = new Font("Arial", fobj.Font.Size, fobj.Font.Style, fobj.Font.Unit,
          fobj.Font.GdiCharSet, fobj.Font.GdiVerticalFont);
        fobj.ApplyFont(ft);
      }
      else if (obj.Kind == ReportObjectKind.FieldObject)
      {
        FieldObject fobj = (FieldObject)obj;
        ft = new Font("Arial", fobj.Font.Size, fobj.Font.Style, fobj.Font.Unit,
          fobj.Font.GdiCharSet, fobj.Font.GdiVerticalFont);
        fobj.ApplyFont(ft);
      }
      else if (obj.Kind == ReportObjectKind.TextObject)
      {
        TextObject fobj = (TextObject)obj;
        ft = new Font("Arial", fobj.Font.Size, fobj.Font.Style, fobj.Font.Unit,
          fobj.Font.GdiCharSet, fobj.Font.GdiVerticalFont);
        fobj.ApplyFont(ft);
      }
    }
  }
}
I don't see a way for changing the fonts in a crosstab or subreport, though.  Hopefully this will at least get you started if you decide to go this route.
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window