Thursday, March 22, 2012

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

sql

No comments:

Post a Comment