Keep report layout when changing printers

Posted by: c1guest_1135307 on 10 September 2017, 11:37 am EST

  • Posted 10 September 2017, 11:37 am EST

    the C1ReportDesigner version 2.6.20102.54119, I created a report with a
    landscape layout with a legal size of 8.5 x 14. This works fine when I
    have a working default printer selected, but there may be times when
    our customer does not have any printer drivers installed on their
    machine. If a printer is not set, the report layout goes down to letter
    size, 8.5 x 11. I am exporting this report to PDF, and i always want
    this reports layout to be 8.5 x 14. How can i achieve this?

  • Replied 10 September 2017, 11:37 am EST

    Hope you are doing well.

    In order to have custom paper size (irrespective of printer), you may refer to the following code:

    Dim cps As PaperSize = New PaperSize("mycustom", 850, 1100) 'define the custom size as per requirements

    C1Report1.Document.DefaultPageSettings.PaperSize = cps

    C1Report1.RenderToFile("C:Report1.pdf", FileFormatEnum.PDF)

    C1PrintPreviewControl1.Document = C1Report1.Document

    Hope it helps.



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels