Problem with programmatically adding components to A4-Report

Stimulsoft Reports.WEB discussion
Post Reply
melzer
Posts: 17
Joined: Wed Oct 03, 2012 9:07 am

Problem with programmatically adding components to A4-Report

Post by melzer »

Hi,

I have written an application to automatically update the reports of our clients.
Sometimes it is necessary to insert components at certain positions, and you cannot do this manually for hundreds of clients and dozens of reports each.
We use reports with 80mm width for POS printers, and also reports in A4 format.
With 80mm reports it works fine, but when you try f.ex. to add bands with a StiText inside to an A4 report, the StiText components are not positioned where they should be.
I have added an example project.

Thanks for your help!

Regards, Florian
Attachments
ReportsSignatur.zip
(2.23 MiB) Downloaded 277 times
melzer
Posts: 17
Joined: Wed Oct 03, 2012 9:07 am

Re: Problem with programmatically adding components to A4-Re

Post by melzer »

I have made some tests, it only happens, when - like in my case - the page property 'Title before Header' is set to true.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problem with programmatically adding components to A4-Re

Post by Alex K. »

Hello,

Please to add the following code:

Code: Select all

Application.DoEvents();

rpt.Load(sReport);
rpt.Info.ShowHeaders = false;

StiReportTitleBand titleband = new StiReportTitleBand();
... // your code for
rpt.Info.ShowHeaders = true;
foreach (StiPage page in rpt.Pages)
{
    page.DockToContainer();
    page.Correct();
}
rpt.Save(sReport);
Thank you.
melzer
Posts: 17
Joined: Wed Oct 03, 2012 9:07 am

Re: Problem with programmatically adding components to A4-Re

Post by melzer »

That's great! Thank you so much.

Best regards, Florian
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problem with programmatically adding components to A4-Re

Post by Alex K. »

Hello Florian

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
Post Reply