Print Page | Close Window

ReportDocument changes my font

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10554
Printed Date: 18 Apr 2024 at 7:13pm


Topic: ReportDocument changes my font
Posted By: wham12
Subject: ReportDocument changes my font
Date Posted: 16 Jul 2010 at 4:41am
I've designed a crystal report that will be sent to a specific (barcode) printer through a web interface. Allowing the report to be generated in the standard crystal report viewer was causing issues, so I am now using the code-behind to send the report directly to the printer.

ReportDocument Report = new ReportDocument();                     
ParameterDiscreteValue Order = new ParameterDiscreteValue();

Order.Value = Convert.ToInt32(txtOrder);
Report.Load(reportPath);
Report.SetParameterValue("OrderNo", Order);

PageMargins margins;
margins = Report.PrintOptions.PageMargins;
margins.bottomMargin = 0;
margins.leftMargin = 0;
margins.rightMargin = 0;
margins.topMargin = 0;

Report.PrintOptions.ApplyPageMargins(margins);
Report.PrintOptions.PrinterName = "\\\\printserver\\Zebra Z6M Plus (300dpi)";              
Report.PrintToPrinter(1, false, PageNum, PageNum);

Report.Close();


When printed from the designer (CRXI) everything works fine but when the web interface sends the job to a printer (any printer) it changes the font to Times New Roman which messes up all of the field sizes. If I use the standard .NET report viewer it uses the correct font (but the barcodes get messed up), so I'm pretty sure the change is being caused by creating/using the ReportDocument.

How can I send the report directly to a print without it defaulting the fonts back to Times New Roman?                                          



Replies:
Posted By: Emir_W
Date Posted: 17 Jul 2010 at 7:10pm
hi..
 
just make sure that all fonts used by the report are registered also in the web server.
because I ever got same issue and its all about the font on my web server.
 
 
hope it help.
 


-------------
Emir W


Posted By: wham12
Date Posted: 19 Jul 2010 at 3:01am
I am currently hosting the web interface on my local development PC, so I know the font is installed and can print correctly to the printer.


Posted By: Mathou68
Date Posted: 06 Dec 2010 at 10:41am
Hi

I have exactly the same problem.

Did you find a solution?

Cheers,


Posted By: wham12
Date Posted: 06 Dec 2010 at 11:15am
I ended up having to change to a different font to get it working. It still doesn't print the same as what shows in the designer, but I was able to adjust the fields so that they printed the way I want them too...even though they don't look right in the designer.


Posted By: russelme
Date Posted: 10 Jun 2014 at 9:31pm
I've had the similar problem and I considered this to be the fonts problem. Anyway, I also not have much experience on the http://www.businessrefinery.com/products/barcode_reader_net/main.html - - barcode software.



Print Page | Close Window