Jump to content

Alternative solution for table content


alexxn

Recommended Posts

I tried an alternative solution to create a "table of content" respect to the sample onesuggested in the jasperreports package.

 

My solution avoid the problem relative to the missing pagination count of index pages and avoid the need to use scriptlet.

 

The solution consists of creating the table of content in the position you prefer (at the beginning of the report for example !!!) using a subreport but substituting page numbers with "key words" in the format THIS_IS_THE_INDEX_PLACEHOLDER+ENTITY_ID.

 

While producing the real report pages, you must put another place holder at the beginning of the sections you inserted precedently in the table of content, in the format of THIS_IS_THE_ENTITY_PLACEOLDER+ENTITY_ID.

 

After produced the report, you should be able to scan programmatically the report pages and you can extract the real pages number of each sections you put in table of content using the THIS_IS_THE_ENTITY_PLACEOLDER+ENTITY_ID string and substitute the correspondig THIS_IS_THE_INDEX_PLACEHOLDER+ENTITY_ID woth the right page number.

 

This solution works fine even with multiple looped subreports!!

 

I'm available for further clarification if you are interested.

Alex N.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi Alex,

 

I am more than happy to hear this news. I have created table of contents as suggested in jasper sample and thinking to add some roman numerals for index page(s).

 

If you can explain me I will modify my report with your valuable solution. I am using many subreports, approx 15.

 

Thanks in advance.

Venkat.

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...

I created an example of the solution.

I hope it is comprehnsible. I know that it isn't so simple, but understanding this solution allows you to do everything you want with TOC!! ;)

 I attached the files in this post but I can't see them so, if they aren't available try to point here :

TOC.jar

out.pdf



Post Edited by Alex Nardelli at 01/16/09 00:22
Link to comment
Share on other sites

  • 6 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...