How to set the page size in code?

Dear all,
How can i set the page size in code?It's not work by follow scripts:

FastReport.Report fastReport = new FastReport.Report();
...
fastReport.PrintSettings.Printer = "<My printer>";
fastReport.PrintSettings.Copies = 2;
fastReport.Pages[0].Page.Height = 8;
fastReport.Pages[0].Page.Width = 10;

fastReport.PrintSettings.ShowDialog = false;
fastReport.Print();

Regards!!!

Comments

  • edited 9:13AM
    Nownew wrote: »
    Dear all,
    How can i set the page size in code?It's not work by follow scripts:

    FastReport.Report fastReport = new FastReport.Report();
    ...
    fastReport.PrintSettings.Printer = "<My printer>";
    fastReport.PrintSettings.Copies = 2;
    fastReport.Pages[0].Page.Height = 8;
    fastReport.Pages[0].Page.Width = 10;

    fastReport.PrintSettings.ShowDialog = false;
    fastReport.Print();

    Regards!!!
    Nownew, i use next code
    using (Report report = new Report())
    {
    report.Load("C:\\.......frx");

    FastReport.ReportPage page = new ReportPage();
    page = (FastReport.ReportPage)report.Pages[0];

    page.TopMargin = float.Parse(TBTop.Text);
    page.LeftMargin = float.Parse(TBLeft.Text);

    report.Prepare();
    }

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.