Problem with StiViewerControl

Stimulsoft Reports.NET discussion
Post Reply
joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Problem with StiViewerControl

Post by joro »

Hello,

we have a problem that needs to get solved urgently.
We use StiViewerControl to show previews of our reports. We face the problem that by the time we print 2 different mrt-files the second one is not displayed correctly.
The page size is still A4 but the font is far too big. Can you please look into the attached screenshot? The first report is correct - the second is completely wrong.

br
joro
Attachments
previewProblem.jpg
previewProblem.jpg (99.2 KiB) Viewed 1724 times
joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Re: Problem with StiViewerControl

Post by joro »

I've found a hint:
Our first report has "millimeter" as report units.
Our second report has "centimeter" as report units.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problem with StiViewerControl

Post by Alex K. »

Hello,

In this case, you need set the similar Report unit for both reports.
For example:

Code: Select all

var report1 = new StiReport();
report1.Load("d:\\report1.mrt");
report1.Render();

var report2 = new StiReport();
report2.Load("d:\\report2.mrt");
report2.ReportUnit = report1.ReportUnit;
report2.Render();

var rep = new StiReport();
rep.Render();
rep.RenderedPages.Clear();
rep.IsRendered = true;

foreach(StiPage page in report1.RenderedPages)
{
    rep.RenderedPages.Add(page);
}
foreach (StiPage page in report2.RenderedPages)
{
    rep.RenderedPages.Add(page);
}
rep.Show();
Thank you.
Post Reply