Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: ReportDocument changes my font Post Reply Post New Topic
Author Message
wham12
Newbie
Newbie


Joined: 16 Jul 2010
Online Status: Offline
Posts: 3
Quote wham12 Replybullet Topic: ReportDocument changes my font
    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?                                          
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet 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
IP IP Logged
wham12
Newbie
Newbie


Joined: 16 Jul 2010
Online Status: Offline
Posts: 3
Quote wham12 Replybullet 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.
IP IP Logged
Mathou68
Newbie
Newbie


Joined: 06 Dec 2010
Online Status: Offline
Posts: 1
Quote Mathou68 Replybullet Posted: 06 Dec 2010 at 10:41am
Hi

I have exactly the same problem.

Did you find a solution?

Cheers,
IP IP Logged
wham12
Newbie
Newbie


Joined: 16 Jul 2010
Online Status: Offline
Posts: 3
Quote wham12 Replybullet 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.
IP IP Logged
russelme
Newbie
Newbie


Joined: 16 Oct 2013
Location: American Samoa
Online Status: Offline
Posts: 1
Quote russelme Replybullet 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 .net barcode reader and don't know to much on the using of barcode software.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.