Direct to Printer Cuts Off Left Side Text

  • windsor5 3 months ago

    Please help me understand the reason for the following:
    Section report designed to print on a receipt printer that has a printable width of 54mm….approximately 2.13 inches. The physical width of the receipt’s paper is approx 2.25 inches.
    The report’s PrintWidth is set to 2.13 in Designer.
    In ReportStart(): PaperKind set to PaperKind.Custom. PageWidth set to 2.13.

    When report is run and directed to ‘print preview’ in the Viewer control, it is displayed at its width of 2.13 inches. When printed from this viewer, a receipt gets printed with a left margin of approx .1″. All report text is printed in the printer’s 2.13 printable area.

    My Issue: if this report does not use the Viewer. If it is run directly to the printer. The leftmost text of the report gets cut off( not printed ) for what looks to be the width of the printer’s default(?) left margin. If i explicitly set the left margin to ~.1″, then everything is good…no text is cut off.

    What i’d like to understand is why i must explicitly set the left margin value when sending the report directly to the printer? How come everything is good when sent to printer from the Viewer, but not when printed direct from program code? btw, even if i change the PageWidth to equal the physical width of the paper roll, 2.25″, the leftmost text will still be cut off.

    Report is created and run in a VS 2013 project using AR 11.
    Thank you.

  • 195p
    AbdiasM195p 2 months, 4 weeks ago

    Can you please attach your report file here so I can check the behavior at my end as well. It’ll be helpful for me to debug the issue if I have the report file. Please mention the exact build version of AR11 that you’re using, as well.

    Thanks

  • windsor5 2 months, 4 weeks ago

    Here you go. Version: 11.0.8705.0

  • 195p
    AbdiasM195p 2 months, 4 weeks ago

    Thanks for the report files. I was able to reproduce the issue after modifying your report and providing my own data to it. The issue happens when printing to a physical printer, but works fine when printing to Pdf or Xps document. I’ve forwarded this issue to the concerned team for further review and will let you know once I have any updates. Tracking Id – 235195

  • windsor5 2 months, 4 weeks ago

    Thank you for checking this out.

  • 195p
    AbdiasM195p 2 months, 3 weeks ago

    Turns out the text is getting cut off because of the printer’s hardware margins, which is controlled by the Printer. If you print the report to a Pdf or Xps and print the Pdf or Xps document, you’ll see the same issue. You could take a look at the following posts which might be of help:

    https://forums.asp.net/t/1688088.aspx?PrintDocument+Unable+to+change+printable+area+via+code

    https://stackoverflow.com/questions/11756429/printersettings-in-c-sharp

    https://stackoverflow.com/questions/2595610/printablearea-in-c-sharp-bug

    Hope it clarifies

  • windsor5 2 months, 3 weeks ago

    @AbdiasM said:
    Turns out the text is getting cut off because of the printer’s hardware margins, which is controlled by the Printer.

    i understand that the printer has hardware margins where it cannot print within. So if a report’s .PrintWidth is set equal to, or less than, the printer’s Printable Width. And the left and right margins are set = 0. Why does ActiveReports attempt to print within the Printer’s hard margins? Shouldn’t it be orienting the left side of the report to begin immediately inside the left hard margin? Please tell me if i am not understanding something here?

    if i were coding a document to print…instead of having ActiveReports handle the print, i believe i could set the PrintDocument’s ‘OriginAtMargins’ property to dictate where the top-left of my document is positioned. Either inside the printer’s hard margins, or at the outside perimeter of those hard margins.
    i do have these reports printing as i want them to print. did this by setting the left/right PageMargins to the width of the printer’s hard margins. just thought that having to set them was unnecessary.

  • windsor5 2 months, 3 weeks ago

    Ok. Checked the value of this particular printer’s hard margins. They are = 0. That explains why i have to set report to start printing at an offset from physical paper edge.

  • 195p
    AbdiasM195p 2 months, 3 weeks ago

    >>Why does ActiveReports attempt to print within the Printer’s hard margins?

    It’s not ActiveReports which attempts to print within the Printer’s hard margins, it’s the Printer’s functionality. As I mentioned in my earlier response, even if I print the exported Pdf or Xps, the text still gets cut off where ActiveReports is not involved in any way. Setting the page margins in the report is the only way to let the Printer not print inside the hard margins and not cut off the text.

  • windsor5 2 months, 3 weeks ago

    Any explanation for why there is a difference in printing direct to printer vs. printing to printer from the AR Viewer? When printing from Viewer…the leftmost text is positioned at (printer’s hard margin + any left margin value i set for the report). When printing direct to printer, leftmost text is positioned only at whatever left margin value is set. i am only trying to make it so that the printed result is always the same. No matter if report is printed from Viewer, or direct to the printer. Thank you.

  • 195p
    AbdiasM195p 2 months, 3 weeks ago

    I’m unable to reproduce this behavior. Even when printing from the Viewer, I can see the text getting cut off. Can you please try AR11 SP1, which is what I’ve used for verification. You may download it from – http://cdn.grapecity.com/ActiveReports/ar11/ActiveReports-v11.1.9726.0.msi

    Please do share your observations with me.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.