Set left margin to 0 in code

Posted by: BenAndMarsha on 5 April 2018, 3:00 pm EST

    • Post Options:
    • Link

    Posted 5 April 2018, 3:00 pm EST - Updated 30 September 2022, 6:23 pm EST

    I have a report where I need the left margin to be set to as small as possible.

    This code seems to have no effect.

        Dim TheMenuTicket As New arMenu
        CType(TheMenuTicket.Sections("PageHeader").Controls("lblTicketTitle"), GrapeCity.ActiveReports.SectionReportModel.Label).Text = GetASetting("Title")
        Dim sWork As String = TheMenuTicket.Document.Printer.DefaultPageSettings.Margins.ToString
        TheMenuTicket.Document.Printer.DefaultPageSettings.Margins.Left = 0
        TheMenuTicket.Run()
        frmPrintReport.Viewer1.LoadDocument(TheMenuTicket.Document)
    

  • Posted 9 April 2018, 6:34 am EST - Updated 30 September 2022, 6:23 pm EST

    You need to set the Margin of the report instead of the Printer. This can be done from the Property Dialogue of the report as shown in the attached screen shot.

Need extra support?

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

Learn More

Forum Channels