Duplicating a page that appears many times in a report

Stimulsoft Reports.NET discussion
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Duplicating a page that appears many times in a report

Post by Edward »

Joel wrote:I created similar page to what you described, just without Databand1. unfortunately, I see the text only on page 1 and not on page2. What am I getting wrong ?
All your steps was correct. The only modification I've made to the report is placing the Container in the Databand and setting the CountData=3 of its DataSource property. Also Page2 may be deleted.
Also was made modifications for the report:
Page.LargeHeightFactor=2;
Page.LargeHeight = true (for convenient designing)

Please use the following link to download the ready report: http://forum.stimulsoft.com/upload/Container.zip


Thank you.
Joel Swift
Posts: 14
Joined: Thu Jan 25, 2007 4:23 am

Duplicating a page that appears many times in a report

Post by Joel Swift »

Many thanks for the fixed report. I understand now the meaning of the propery CountData. I also have another situtaion:

- I have a sequence of 2 pages, for example page 1 and page 2, which are different.
- I would like to create page 3 and page 4, so page 3 is like page 1(same controls, but different data, as the case above), and similarily page 4 is like page 2, so I get the sequence:
page1
page2
page3 (like page1)
page4 (like page2)

How can I do that?

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Duplicating a page that appears many times in a report

Post by Edward »

After rendering of the report you may reorder pages on your taste.
The following code in the Event handler Report.EndRenderEvent allows to change the order of the 3(!) rendered pages to the inverse order.

Code: Select all

this.RenderedPages.Add(this.RenderedPages[1].Clone() as StiPage);
this.RenderedPages.Add(this.RenderedPages[0].Clone() as StiPage);
this.RenderedPages.RemoveAt(0);
this.RenderedPages.RemoveAt(0);
The following code in the EndRenderEvent allows to achive the order you are requested (you have Page1 and Page2 in template. Every page produces 2 rendered pages):

Code: Select all

this.RenderedPages.Add(this.RenderedPages[2].Clone() as StiPage);
this.RenderedPages.Add(this.RenderedPages[1].Clone() as StiPage);
this.RenderedPages.Add(this.RenderedPages[3].Clone() as StiPage);
this.RenderedPages.RemoveAt(1);
this.RenderedPages.RemoveAt(1);
this.RenderedPages.RemoveAt(1);
Result is the following:
Page1(1)
Page2(1)
Page1(2)
Page2(2)

Also may be possible the following technic:
You may also clone a template of the Reports Page. In the BeginRenderEvent event of the Report object in the Events Tab of the report Property Editor you should place the following code:

Code: Select all

this.Pages.Add(this.Pages[0].Clone() as StiPage);
Result will be the following:

Page1(1)
Page1(2)
Page2(1)
Page2(2)
Page1(3)
Page1(4)

Thank you.
Post Reply