Page 1 of 1

Problem with programmatically adding components to A4-Report

Posted: Fri Jul 15, 2016 7:54 am
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

Re: Problem with programmatically adding components to A4-Re

Posted: Fri Jul 15, 2016 10:45 am
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.

Re: Problem with programmatically adding components to A4-Re

Posted: Mon Jul 18, 2016 8:52 am
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.

Re: Problem with programmatically adding components to A4-Re

Posted: Mon Jul 18, 2016 1:34 pm
by melzer
That's great! Thank you so much.

Best regards, Florian

Re: Problem with programmatically adding components to A4-Re

Posted: Mon Jul 18, 2016 3:24 pm
by Alex K.
Hello Florian

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

Thank you.