This is a migrated thread and some comments may be shown as answers.

Label prints in wrong orientation when the paper width is greater than height

6 Answers 493 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Iron
Joel asked on 26 Feb 2014, 07:22 AM
As odd as it may sound, this is what i am facing.
I am printing the barcode report to Agrox CP-2140 PPLB label printer.
The paper size is set to 104 mm (W) and 60mm (H).
When print, the label appears in landscape orientation (which is not what i want because it occupies 2 stickers)

When the paper size is set to 104mm (W) and 104mm(H), the label is printed in portrait orientation. However, this is also not desirable because the printer is advancing more empty labels.

I am using Q3 2013 SP1, version 7.2.14.127.

Here is my print code:
m_ReelLabel.UnitOfMeasure = UnitType.Mm;
m_ReelLabel.Width = new Unit(98.0, UnitType.Mm);
DetailSection detail = new DetailSection();
detail.Height = new Unit(50.0, UnitType.Mm);

m_ReelLabel.PageSettings.PaperKind = PaperKind.Custom;
m_ReelLabel.PageSettings.PaperSize = new SizeU(new Unit(104, UnitType.Mm), new Unit(60, UnitType.Mm));
m_ReelLabel.PageSettings.Margins.Left = new Unit(2.0, UnitType.Mm);
m_ReelLabel.PageSettings.Margins.Right = new Unit(2.0, UnitType.Mm);
m_ReelLabel.PageSettings.Margins.Top = new Unit(2.0, UnitType.Mm);
m_ReelLabel.PageSettings.Margins.Bottom = new Unit(2.0, UnitType.Mm);
 
InstanceReportSource src = new InstanceReportSource();
src.ReportDocument = m_ReelLabel;
 
PrinterSettings printerSettings = new PrinterSettings();
PrintController standardPrintController = new StandardPrintController();
Telerik.Reporting.Processing.ReportProcessor processor = new Telerik.Reporting.Processing.ReportProcessor();
processor.PrintController = standardPrintController;
processor.PrintReport(src, printerSettings);

6 Answers, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 1
Iron
answered on 28 Feb 2014, 01:09 AM
Please answer this post as i need to complete the label printing for my customer soon.
The label size is fixed by my customer, which is 100mm(W) and 60mm(W).
Even printing with the Report Desinger also produce the same result.
0
Joel
Top achievements
Rank 1
Iron
answered on 28 Feb 2014, 01:30 AM
Please see attached pictures to better understand my illustration.
0
Joel
Top achievements
Rank 1
Iron
answered on 28 Feb 2014, 02:21 AM
Tested with Q1 2014 Report Designer, the orientation is still wrong.
Attached screenshot of Report Designer.
0
Nasko
Telerik team
answered on 28 Feb 2014, 05:21 PM
Hello Joel,

In general, Telerik Reporting is a general purpose reporting engine, which primary goal is to analyze data and represent it in a human-readable format that is also suitable for printing. It has no specific features in terms of label printer support.

Note that our current implementation for the printing functionality always sets Landscape to true when the width of the page is larger than the height in order for the printing to work correctly on a regular printer. It is possible that a label printer additionally rotates the image, but this can be usually controlled by the label printer settings.

If the label printer doesn't offer such option, then you can work around this by rendering the report to XPS format using the ReportProcessor.ReportMethod and then print it programmatically as described in the How to: Programmatically Print XPS Files article.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Joel
Top achievements
Rank 1
Iron
answered on 03 Mar 2014, 05:46 PM
[quote]Nasko said:
Note that our current implementation for the printing functionality always sets Landscape to true when the width of the page is larger than the height in order for the printing to work correctly on a regular printer.
 
[/quote]

Doing this silently without highlighting it in the documentation just add that much of confusion and frustration....
It does not show in landscape when preview in Report Designer tool....
Moreover this behavior can't be overridden....
0
Accepted
Nasko
Telerik team
answered on 06 Mar 2014, 03:45 PM
Hello Joel,

Thank you for the provided feedback.

We will consider adding this information to our online documentation.

Currently, this behavior cannot be overridden, but you can work around it following the suggestion provided in my previous reply.

Regards,
Nasko
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Tags
General Discussions
Asked by
Joel
Top achievements
Rank 1
Iron
Answers by
Joel
Top achievements
Rank 1
Iron
Nasko
Telerik team
Share this question
or