Page Setup Keeps Defaulting to A4, but we need Letter

Stimulsoft Reports.WPF discussion
Post Reply
Linksys1
Posts: 5
Joined: Wed Mar 10, 2010 12:50 pm
Location: Edmonton

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Linksys1 »

Our company (in Canada) is using your product to produce reports from our .NET application. What we've found with certain printers is the report margins and/or paper size default to A4 but we need the reports to print in Letter format. Even selecting Letter in certain circumstances causes the report to print improperly. We also get a printer error that gets reported on the last page of the report.


Here is an email I received from one of our users when they went to print a Stimulsoft report from our application. BTW: Our application in now way controls any of our printers.

"I have changed to letter and printed the attached diary report.

The first example is how the report printed and the second example is same report – letter size altered and then saved to pdf file. There was an error message that popped up when saving to pdf, but appeared to save correctly.

Whenever I go to print a report – I have to alter the A4 sized paper to letter and adjust the width.

help"


The error that appears on the last page of the report is:

PCL XL error
Warning: IllegalMediaSize


Any insight into this would be greatly appreciated. A collegue of mine informed me this is a known bug in Stimulsoft. Is this correct?
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Andrew »

Hello,

As far as we can see from the message the printer does not support the specified page size of a report. Page size of a report can specified by two ways: using the PageSize property of a page and using the page size (PageSize = Custom). If you set the value for the PageSize property to Letter (for example), then the reporting tool directly sends to the printer which paper size should be set. Page size is not taken into consideration (PageWidth and Pageheight properties).
If the printer does not support such paper size, then, most probably you'll get the error message. If the pageSize is Custom, then the reporting tool searches all papaer sizes which are supported with the printer.
If the paper size matches with the required one, then this size is used. If the paper size is not found, then the reporting tool specifies to printer that the page should be printed with user-defined sizes. If the printer does not support such paper size (printer driver) you will get the error message.

Thank you.
Linksys1
Posts: 5
Joined: Wed Mar 10, 2010 12:50 pm
Location: Edmonton

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Linksys1 »

Hi Andrew,

Thanks for the fast reply.

The printer in question does support A4 and LETTER paper size. The issue the user(s) have occurs only when printing a Stimulsoft report from our application. If they were to print from, say Word, they would not receive the error, and the report (or document, or whatever) prints just fine, and without any errors/warnings.

What else is odd is the user having to set the paper = LETTER everytime... A4 is always the default paper size.

The other odd thing is that I was able to print the same report from my PC over the network to the printer in question (is in a different city). The report printed fine for me, but it does not print out for the users the printer is directly connected to.

Any other ideas?

Can the paper size be programmically set in C# code?
Linksys1
Posts: 5
Joined: Wed Mar 10, 2010 12:50 pm
Location: Edmonton

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Linksys1 »

We went in and switched the color driver to a black and white driver. The report works fine now. That may be a quick fix but it isn't a solution. Our work around also involved creating a new configuration so the users can select either the B/W printer or the Color printer on the network (one driver for each).

Can you provide me with a list of known compatible printers? As we continue to buy printers we do not want to purchase one that is incompatible with your software.

Is there a certain feature set that needs to be in a printer for Stimulsoft reports to work?

Thanks.
Dave
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Jan »

Hello,
The printer in question does support A4 and LETTER paper size. The issue the user(s) have occurs only when printing a Stimulsoft report from our application. If they were to print from, say Word, they would not receive the error, and the report (or document, or whatever) prints just fine, and without any errors/warnings.
Word create print task with help of GDI. Report generator use .Net Framework which use for printing GDI Plus. Time to time GDIPlus does not work correct in places where GDI work fine. Some time ago we request similar request from our customers. In latest case problem was solved with help of previous version of printer drivers.
What else is odd is the user having to set the paper = LETTER everytime... A4 is always the default paper size.
You can use following code to change default paper size:

Code: Select all

Stimulsoft.Report.StiOptions.Engine.DefaultPaperSize = PaperKind.Letter;
All new reports will be use Letter paper size as default.
The other odd thing is that I was able to print the same report from my PC over the network to the printer in question (is in a different city). The report printed fine for me, but it does not print out for the users the printer is directly connected to.
I think problem in driver of printer. Word and Framework use different api for printing. Try to set same driver (as on your computer) on user computer.
We went in and switched the color driver to a black and white driver. The report works fine now. That may be a quick fix but it isn't a solution. Our work around also involved creating a new configuration so the users can select either the B/W printer or the Color printer on the network (one driver for each).
Can you say which model of print used? HP? If HP try to set another version of driver. Try to use for printing not PCL mode.

Thank you.
Linksys1
Posts: 5
Joined: Wed Mar 10, 2010 12:50 pm
Location: Edmonton

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Linksys1 »

The printers in question are Brother printers (model #'s are different between our branches though).
We also have HP printers that are working/printing fine.

I will have a look into GDI+.
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Page Setup Keeps Defaulting to A4, but we need Letter

Post by Andrew »

Hello,

We surfed internet and found the forum thread very similar to your problem http://www.msofficeforums.com/word/2979 ... -size.html
Unfortunately, with no answer. It seems that this is the problem of drivers.

Thank you.
Post Reply