Table of contents and page numbering

Stimulsoft Reports.NET discussion
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Table of contents and page numbering

Post by socotek »

We have final report that is made from different report file .mrt.
We need to have this dinamically creation because of client that choose what he wants.

For example, our code is like this below:

Code: Select all

Dim reportAss = New StiReport
Dim report1 = New StiReport
Dim report2 = New StiReport
...
'Create report1 with data
'Create report2 with data
...
reportAss.SubReports.Add(report1)
reportAss.SubReports.Add(report2)
The questions are:
- how we can insert the number of pages?
- how we can include table of contents?

Can you provide us, one or some examples, with code?

Thank you very much and happy new year,
Luca
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Table of contents and page numbering

Post by HighAley »

Hello, Luca.

The better way is to design the one report template with different pages.
When you use the SubReports collection, each report in it is rendered separately and we can't guarantee you that it will be possible to create a table of contents.

Thank you.
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Re: Table of contents and page numbering

Post by socotek »

How can report template works?
Can you provide us an example with code?
In particular we need to verify number of pages and table of contents in a report dinamically created.

Many thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Table of contents and page numbering

Post by HighAley »

Hello.

You could learn how to create such report in the Creating Report with Anchors tutorial video.

Thank you.
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Re: Table of contents and page numbering

Post by socotek »

Hello Aleksey,
Thank you so much for your previous answers.

I understand report template is a single report (.mrt) with multi pages, so, in this scenario, we should have one single report (.mrt) with, for example, 20 pages.

Now, our purposes are:
  • 1. not all our clients can have the 20 pages, someone just ten pages of the twenty, someone just fifteen pages of the twenty, and the rest all the twenty pages;
  • 2. we would like to re-use some pages of report in different part of our program: for example, the page 4, 5, 6 can be displayed and printed in another part of the program. The solution to create 2 report template (first from page 1 to page 20, and second from page 4 to page 6) doesn't simplify the updates in the commons pages (we must do the update two times);
  • 3. we have a particular case, to show a part of report (like page 4, 5, 6 said before) with a cover personalized on the single customer that we designed in a different file .mrt;
Besides, in the scenario described above, we need to have the table of contents and the page numbering on the single pages.
I read your 822.Topic2.pdf document (How Can I Add A Table Of Contents To A Multi Page Report?): is it possible to do with some different .mrt file?

At last, I have tried to install your last release Stimulsoft Reports.Net 2014.3, but the installation fails because of a cabinet file that has an invalid digital signature. It happened on a test pc, but not on a development pc. Do we need something, like a internet connection?
Now we are evaluating the Stimulsoft Reports.Net 2014.1 version; is it suitable for all the thing I described above?

Thank you very much for your attention,
Luca
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Table of contents and page numbering

Post by HighAley »

Hello.
At last, I have tried to install your last release Stimulsoft Reports.Net 2014.3, but the installation fails because of a cabinet file that has an invalid digital signature. It happened on a test pc, but not on a development pc. Do we need something, like a internet connection?
You do not need Internet connection. Please, try to download the release from our site again.

There is a way out. But there should be different names of all components of all reports.
You could get the pages from StiReport.Pages collection and gather necessary pages in a report template with table of contents on first page.

The TOC will be generated on rendering time. You should have a list of TOC items.

Thank you.
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Re: Table of contents and page numbering

Post by socotek »

Hello Aleksey,
I understand report template is a single report (.mrt) with multi pages, so, in this scenario, we should have one single report (.mrt) with, for example, 20 pages.

Now, our purposes are:

1. not all our clients can have the 20 pages, someone just ten pages of the twenty, someone just fifteen pages of the twenty, and the rest all the twenty pages;

2. we would like to re-use some pages of report in different part of our program: for example, the page 4, 5, 6 can be displayed and printed in another part of the program. The solution to create 2 report template (first from page 1 to page 20, and second from page 4 to page 6) doesn't simplify the updates in the commons pages (we must do the update two times);

3. we have a particular case, to show a part of report (like page 4, 5, 6 said before) with a cover personalized on the single customer that we designed in a different file .mrt;
I don't understand from your answer if a report template is a single report .mrt.

And for points 1., 2., 3., do you have some suggestion how to manage those scenrios?

For the TOC, I will do an example soon, if I need I write you back.

Thank you,
Luca
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Re: Table of contents and page numbering

Post by socotek »

Hello,
There is a way out. But there should be different names of all components of all reports.
You could get the pages from StiReport.Pages collection and gather necessary pages in a report template with table of contents on first page.

The TOC will be generated on rendering time. You should have a list of TOC items.
I tryed to do something similar as you described. My code is:

Code: Select all

Dim rp As New StiReport
Dim rp1 As New StiReport
Dim rp2 As New StiReport

rp1.Load("C:\...\Pagina_1.mrt")
rp2.Load("C:\...\Pagina_2.mrt")
rp.Pages.AddRange(rp1.Pages)
rp.Pages.AddRange(rp2.Pages)
rp.Dictionary.Merge(rp1.Dictionary)
rp.Dictionary.Merge(rp2.Dictionary)
rp.Show()
Pagina_1.mrt and Pagina_2.mrt each contains only one page.

But function show goes in error: "Object referecee not set to an instance of an object".
Am I doing the right way?

Thank you,
Luca
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Table of contents and page numbering

Post by HighAley »

Hello, Luca.

Please, send us a sample project with necessary data to reproduce the issue.

Thank you.
socotek
Posts: 56
Joined: Thu Jun 26, 2014 9:40 am

Re: Table of contents and page numbering

Post by socotek »

Hello,
how can I print a page more times in a report template?
My template contains a TOC, I need to print Page2 a variable number of times and the TOC should print each page number.

Thank you.

Luca
Post Reply