cancel
Showing results for 
Search instead for 
Did you mean: 

Building a Table of Contents (TOC)

Former Member
0 Kudos

If I have a report that holds unlimited number of subreports that were programmatically added, how is the best way to determine the page number in the master report of the first page of each subreport?

I will then build a string containing the report name and first page for each subreport ...then stuff this into a parameter on the main report which will be used to display a table of contents.

If there is a better way, please let me know... but I am not sure how to read where the first page number falls on each subreport inside the main report. If I knew the subreports GetLastPageNumber, I may be able to calculate it... but I was not sure how to get this property on the subreport. It does not appear to be a property of the subreport ReportDocument object.

Thanks,

Jeff

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Jeff,

Firstly there is no such thing as unlimited number of subreports. This is dangerous planning, Report Design is based on computer resources and Database design and depending on where you put the subreport it can cause the report and every subreport to run on every page change.

I highly suggest you log this case in the Crystal Report Designer forums first to determine the proper way of designer a report for your needs.

Be sure to indicate what version of Crystal Reports you are using.

Thank you

Don

Former Member
0 Kudos

When I say unlimited, I really mean that they are not inserted in the designer... they are inserted in code. I am not using the designer to insert subreports... this method works fine. If I see resource limitations, I can programmatically limit the number of reports the user can include in a the overall report.

Back to my original question, I need to get the page number from where the subreport's first page falls in the main report.

Thanks for the warning, but I need to stay on this track and I can programmatically manage it.

I am using Crystal 2008 - FixPack 2 with Visual Studio 2008 - SP1

Jeff

0 Kudos

Hi Jeff,

Thank you for explaining.

You will need to use RAS (Report Application Server) and the ClientDoc methods.

Is this a Windows or WEB app?

The problem is you can't determine the page number until the report is run, Using Page M of N in the report may help but this forces the report to run also and can look as if there is a delay when viewing the report.

I still suggest you log your case with the Report Design team. Basically if you can duplicate the report in CR Designer then you can get the info in our SDK. Depending on where and which section you are inserting your subreports depends on how you might be able to get the info.

Start from your output test report designed in CR Designer and then reverse engineer the report to be used in code.

I don't believe there will be a simple way to get the numbers. CR Design Team can help you with the template report.

Thank you

Former Member
0 Kudos

This is a windows application - VB.Net 2008.

I am using RAS to insert the subreports. I was wanting to know what object

in the SDK that I can read to get the page number or the total pages in a subreport.

I can calculate the starting page if I know the number of pages in a subreport.

What properties do I read in the ClientDoc? .... I cannot find the

GetLastPageNumber in the ClientDoc object on a subreport.

What Crystal documentation should I normally be able to look this kind

of stuff up instead of asking the forum? I do not even see GetLastPageNumber

in crsdk_net_ReportDocument_object_model_diagram_12.pdf Is there any document anywhere that lists all methods / properties / attributes of every Crystal Library for me to look stuff up?

Thanks,

Jeff

former_member184995
Active Contributor
0 Kudos

The SDK information is here:

[Developer Library|https://boc.sdn.sap.com/developer/library]

I am not sure that what you are trying to do is possible, at least not easily and we would not have any samples on how to do it. If someone does, please share it

Answers (0)