Page 1 of 1
Adding pages to a mrt-template from code
Posted: Tue Dec 25, 2012 3:55 pm
by gunde99
Hi!
I'm loading a mrt-file in a C#-project and are trying to add pages before compiling, rendering and exporting to pdf. The page gets added but is empty. What am I missing?
I've attached both the code and the mrt-file.
Re: Adding pages to a mrt-template from code
Posted: Wed Dec 26, 2012 6:58 am
by HighAley
Hello.
Please, send us a working project which reproduces the issue for analysis.
Thank you.
Re: Adding pages to a mrt-template from code
Posted: Fri Dec 28, 2012 11:59 am
by gunde99
Hi!
You've allready had all the code in the CreateReport.cs, attached in my first post, but I made a full working project. Just put the Report_test.mrt-file in C:\Temp\Stimulsoft\ or change the path in Form1.cs.
Thanks
Re: Adding pages to a mrt-template from code
Posted: Sat Dec 29, 2012 10:04 am
by Alex K.
Hello,
Please try to change the following code:
Code: Select all
public StiPage CreateNewPage(String name, StiReport report)
{
\\StiPage p = new StiPage();
StiPage p = new StiPage(report);
...
Thank you.
Re: Adding pages to a mrt-template from code
Posted: Mon Dec 31, 2012 12:22 am
by gunde99
Fantastic! That showed the objects but still no text in the boxes. So used the same strategy and instead of using the empty constructor, to create the textboxes, I sent in a rectangle and the text. That made the difference and now everything works as intended.
Thank you very much and happy New Year!
Re: Adding pages to a mrt-template from code
Posted: Mon Dec 31, 2012 1:19 pm
by Alex K.
Hello,
Great!
Let us know if you need any additional help.
Happy New Year!!