Page 1 of 2
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 2:55 am
by Joel Swift
Hi,
My report consists of 3 pages, where all the pages are of the same structure, only the data changes. For example, all have a title, headerband and databand and a chart. Is there an option to wrap all those controls to a sort of user control, and use it in each page, instead of creating 3 pages and copy the controls to each page? If I copy controls to each page, and I would like to add another title to a page, I will have to add the title to each one of the 3 (or more) pages.
Thanks,
Joel
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:08 am
by Edward
Please set Page.PrintHeadersFootersFromPreviousPage property to true for the Page2 and Page3.
Also last Prerelease versions of the StimulReport.Net has an ability of inheritance. Please read more about it in the following topic:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=316
Thank you.
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:11 am
by Edward
Edward wrote:Please set Page.PrintHeadersFootersFromPreviousPage property to true for the Page2 and Page3.
Also last Prerelease versions of the StimulReport.Net has an ability of inheritance. Please read more about it in the following topic:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=316
Thank you.
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:20 am
by Joel Swift
I'm not sure it's an inheritance issue, since the report includes also some other pages.
If I use Page.PrintHeadersFootersFromPreviousPage property, how do I set the control content of each page:the title text, the headerband texts, etc...
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:32 am
by Edward
On the first page of the report you should define PageHeaders and PageFooters. After that when you set Page2.PrintHeadersFootersFromPreviousPage = true and
Page3.PrintHeadersFootersFromPreviousPage = true then the headers and footers from the Page1 will be used on the Page1 and Page2. Headers and Footers also have property PrintOnAllPages.
Thank you.
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:39 am
by Joel Swift
What is the behavior when the pages include also StiText, databand, etc...? Where do I set its content ?
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 3:46 am
by Edward
Please describe your task with more details.
Thank you.
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 4:09 am
by Joel Swift
I'm realy sorry I was not clear enough. I'll try to explain it better:
- My report should include some pages which are of the same structure:
Title
headerband
databand
chart
- The difference between those pages is the controls content, for example: the content of page one is:
Title: "Page 1 Title"
headerband - "Page 1 headerband"
databand - Page 1 databand datasource
chart - Page 1 values
The content of page 2, will be similarily:
Title: "Page 2 Title"
headerband - "Page 2 headerband"
databand - Page 2 databand datasource
chart - Page 2 values
and so on with other pages. (My report also include other pages with different structure, so I cannot use inheritance).
My question: is there an option to wrap the repeating controls to some wide control which can be used in the pages?
something like:
Page1.add("WideConrol");
Page2.add("WideConrol");
Page1.Components["WideConrol"].TitleText = "Page 1 title";
Page2.Components["WideConrol"].TitleText = "Page 2 title";
I hope my problem is clearer now.
Thanks in advance,
Joel
Duplicating a page that appears many times in a report
Posted: Wed Feb 07, 2007 5:02 am
by Edward
Thank you for describing your task.
Please do the following steps:
1. Place PageHeader1 and PageFooter1 on the page. And place there desired StiTexts.
2. Place a Databand1 and set DataBand1.CountData = 3.
3. Place a Container1 inside the DataBand1.
4. Inside the Container1 place HeaderBand,DataBand2,Chart and FooterBand, please.
There exists a Page1.BeforePrintEvent.
In the EventHadler of that event you should place a code like this:
Code: Select all
if (PageNumber == 1)
{
Text1.TextValue = "MyText1";
}
if (PageNumber == 2)
{
Text1.TextValue = "MyText2";
}
Also please set the following properties:
DataBand1.ResetDataSource = true
DataBand2.StartNewPage = true
Thank you.
Duplicating a page that appears many times in a report
Posted: Thu Feb 08, 2007 6:46 am
by Joel Swift
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 ?