Page 1 of 1

StiResizeReportHelper.ResizeReport

Posted: Tue Jun 21, 2011 1:39 am
by Martin Hart Turner
Hi:

Can you tell me how I might use the class Stimulsoft.Report.StiResizeReportHelper.ResizeReport(...) to resize a report before printing it?

My aim is to resize a report from A4 to A5 paper and print it; without changing the report template. I know the Windows Viewer supports scaling, but what about scaling when I send my report directly to the printer?

Thanks,
Martin.

StiResizeReportHelper.ResizeReport

Posted: Wed Jun 22, 2011 3:25 am
by Ivan
Hello,

Please try to use the following code, for example:

Code: Select all

            StiReport stiReport = new StiReport();
            stiReport.Load(@"d:\SimpleList.mrt");
            stiReport.Render();

            PaperSize newSize = new PaperSize("A5", 583, 827);
            newSize.RawKind = (int)PaperKind.A5;

            StiResizeReportHelper.ResizeReport(stiReport,
                StiPageOrientation.Portrait,
                newSize.Kind,
                stiReport.Pages[0].Margins,
                stiReport.Unit.ConvertFromHInches(newSize.Width),
                stiReport.Unit.ConvertFromHInches(newSize.Height),
                StiResizeReportOptions.RescaleContent | StiResizeReportOptions.ProcessAllPages,
                0);

            stiReport.Print();
Thank you.

StiResizeReportHelper.ResizeReport

Posted: Fri Jun 24, 2011 2:02 am
by Martin Hart Turner
Ivan:

Truly amazing! This has saved me many, many hours of work.

Thanks very much, regards,
Martin.

StiResizeReportHelper.ResizeReport

Posted: Fri Jun 24, 2011 7:57 am
by Andrew
Hello,

Great! Have a nice weekend!