Issue with printing from WebReport
Hello everyone,
I am unfortunately experiencing a very weird issue.
Basically, I am printing to a continous chit printer via the webreport component. On selecting print via browser option (to an Epson TM20 chit printer), the browser is generating an extra page (as per image 1) and causing the printer to go in error state. Tried this both through Chrome and Edge.
As a side note, the size of the paper is being calculated at runtime via the below script which is taking effect (Text112.Text is outputting the right values).
I would appreciate any insight.
Thanks in advance!
alex
Code below to calculate the page height:
private void Data1_AfterPrint(object sender, EventArgs e)
{
reportHeight += (sender as BandBase).Height;
}
private void Page1_StartPage(object sender, EventArgs e)
{
if(Engine.FinalPass)
{
Page1.PaperHeight = (reportHeight + GroupHeader1.Height+GroupHeader2.Height+
GroupFooter2.Height+GroupFooter1.Height)/Units.Millimeters + Page1.TopMargin +
Page1.BottomMargin;
Text112.Text= Page1.PaperHeight.ToString();
}
}
Comments
Hello!
To resolve the issue, switch the print mode to PDF printing in the WebReport toolbar (PrintInPdf / endpoint exportFormat=pdf) and set the actual receipt height during the first pass (DoublePass = true) to the total height of the content in Page.PaperHeight (width 80 mm, margins 0–2 mm).
If you are still using HTML printing, force the margins to be reset in the print window’s CSS: @page { margin: 0; } and reduce the calculated PaperHeight by 2–4 mm to allow for a safety margin.