HIDDEN TEXT TO MARK THE BEGINNING OF THE TABEL OF CONTENTS
Orders Report
Here is a simple example that shows how to create a table of contents for your report.
There are various ways to build tables of contents. Just let free your imagination and be creative, because JasperReports is very flexible and won't let you down. Most of the time you will end up using scriptlets and subreports, like we have in this sample.

Note, that normally, the table of contents is generated as the report itself is being built. In this sample, it is generated using a subreport placed on the master report summary section and using data prepared by the master report scriptlet object. After the report is generated, the table of contents appears at the end of the master report, as you would expect after checking the report design.
But the parent application performs a trick or a hack, or whatever you want to call it to remove the table of contents from the end of the document and insert it at the beginning.
This operation has apparently only one inconvenience. The final document does not reflect the modification in the order of pages. You can see that in our sample, the table of contents does not display a page number on the footer and that the page #1 comes after the table of contents.
Table of Contents
Letter A ___________________________________ 1
Argentina . . . . . . . . . . . . . . . . . . . 1
Austria . . . . . . . . . . . . . . . . . . . 1
Letter B ___________________________________ 2
Belgium . . . . . . . . . . . . . . . . . . . 2
Brazil . . . . . . . . . . . . . . . . . . . 3
Letter C ___________________________________ 6
Canada . . . . . . . . . . . . . . . . . . . 6
Letter D ___________________________________ 7
Denmark . . . . . . . . . . . . . . . . . . . 7
Letter F ___________________________________ 7
Finland . . . . . . . . . . . . . . . . . . . 7
France . . . . . . . . . . . . . . . . . . . 8
Letter G ___________________________________ 10
Germany . . . . . . . . . . . . . . . . . . . 10
Letter I ___________________________________ 14
Ireland . . . . . . . . . . . . . . . . . . . 14
Italy . . . . . . . . . . . . . . . . . . . 15
Letter M ___________________________________ 16
Mexico . . . . . . . . . . . . . . . . . . . 16
Letter N ___________________________________ 17


Table of Contents
Norway . . . . . . . . . . . . . . . . . . . 17
Letter P ___________________________________ 17
Poland . . . . . . . . . . . . . . . . . . . 17
Portugal . . . . . . . . . . . . . . . . . . . 17
Letter S ___________________________________ 18
Spain . . . . . . . . . . . . . . . . . . . 18
Sweden . . . . . . . . . . . . . . . . . . . 18
Switzerland . . . . . . . . . . . . . . . . . . . 20
Letter U ___________________________________ 20
UK . . . . . . . . . . . . . . . . . . . 20
USA . . . . . . . . . . . . . . . . . . . 22
Letter V ___________________________________ 26
Venezuela . . . . . . . . . . . . . . . . . . . 26


ID Name City
Countries Starting With Letter : A
1. Argentina
11054 Cactus Comidas para llevar Buenos Aires
11019 Rancho grande Buenos Aires
10986 Océano Atlántico Ltda. Buenos Aires
10958 Océano Atlántico Ltda. Buenos Aires
10937 Cactus Comidas para llevar Buenos Aires
10916 Rancho grande Buenos Aires
10898 Océano Atlántico Ltda. Buenos Aires
10881 Cactus Comidas para llevar Buenos Aires
10828 Rancho grande Buenos Aires
10819 Cactus Comidas para llevar Buenos Aires
10782 Cactus Comidas para llevar Buenos Aires
10716 Rancho grande Buenos Aires
10531 Océano Atlántico Ltda. Buenos Aires
10521 Cactus Comidas para llevar Buenos Aires
10448 Rancho grande Buenos Aires
10409 Océano Atlántico Ltda. Buenos Aires
Count : 16
2. Austria
11072 Ernst Handel Graz
11053 Piccolo und mehr Salzburg
11017 Ernst Handel Graz
11008 Ernst Handel Graz
10990 Ernst Handel Graz
10979 Ernst Handel Graz
10968 Ernst Handel Graz
10895 Ernst Handel Graz
10854 Ernst Handel Graz
10844 Piccolo und mehr Salzburg
10836 Ernst Handel Graz
10795 Ernst Handel Graz
10776 Ernst Handel Graz
Page 1 of 27


ID Name City
10773 Ernst Handel Graz
10771 Ernst Handel Graz
10764 Ernst Handel Graz
10747 Piccolo und mehr Salzburg
10698 Ernst Handel Graz
10686 Piccolo und mehr Salzburg
10667 Ernst Handel Graz
10633 Ernst Handel Graz
10597 Piccolo und mehr Salzburg
10595 Ernst Handel Graz
10571 Ernst Handel Graz
10530 Piccolo und mehr Salzburg
10514 Ernst Handel Graz
10489 Piccolo und mehr Salzburg
10442 Ernst Handel Graz
10430 Ernst Handel Graz
10427 Piccolo und mehr Salzburg
10402 Ernst Handel Graz
10403 Ernst Handel Graz
10392 Piccolo und mehr Salzburg
10390 Ernst Handel Graz
10382 Ernst Handel Graz
10368 Ernst Handel Graz
10353 Piccolo und mehr Salzburg
10351 Ernst Handel Graz
10263 Ernst Handel Graz
10258 Ernst Handel Graz
Count : 40
Countries Starting With Letter : B
3. Belgium
11038 Suprêmes délices Charleroi
11035 Suprêmes délices Charleroi
11004 Maison Dewey Bruxelles
Page 2 of 27


ID Name City
10978 Maison Dewey Bruxelles
10930 Suprêmes délices Charleroi
10896 Maison Dewey Bruxelles
10892 Maison Dewey Bruxelles
10885 Suprêmes délices Charleroi
10846 Suprêmes délices Charleroi
10841 Suprêmes délices Charleroi
10767 Suprêmes délices Charleroi
10760 Maison Dewey Bruxelles
10649 Maison Dewey Bruxelles
10529 Maison Dewey Bruxelles
10475 Suprêmes délices Charleroi
10463 Suprêmes délices Charleroi
10458 Suprêmes délices Charleroi
10302 Suprêmes délices Charleroi
10252 Suprêmes délices Charleroi
Count : 19
4. Brazil
11068 Queen Cozinha Sao Paulo
11059 Ricardo Adocicados Rio de Janeiro
11052 Hanari Carnes Rio de Janeiro
11049 Gourmet Lanchonetes Campinas
11042 Comércio Mineiro Sao Paulo
11022 Hanari Carnes Rio de Janeiro
10989 Que Delícia Rio de Janeiro
10981 Hanari Carnes Rio de Janeiro
10969 Comércio Mineiro Sao Paulo
10961 Queen Cozinha Sao Paulo
10959 Gourmet Lanchonetes Campinas
10935 Wellington Importadora Resende
10925 Hanari Carnes Rio de Janeiro
10922 Hanari Carnes Rio de Janeiro
10914 Queen Cozinha Sao Paulo
10913 Queen Cozinha Sao Paulo
Page 3 of 27


PAGES FROM 4 TO 26 WERE MANUALLY REMOVED TO REDUCE FILE SIZE


ID Name City
10499 LILA-Supermercado Barquisimeto
10490 HILARION-Abastos San Cristóbal
10486 HILARION-Abastos San Cristóbal
10485 LINO-Delicateses I. de Margarita
10476 HILARION-Abastos San Cristóbal
10461 LILA-Supermercado Barquisimeto
10405 LINO-Delicateses I. de Margarita
10395 HILARION-Abastos San Cristóbal
10381 LILA-Supermercado Barquisimeto
10357 LILA-Supermercado Barquisimeto
10330 LILA-Supermercado Barquisimeto
10296 LILA-Supermercado Barquisimeto
10283 LILA-Supermercado Barquisimeto
10268 GROSELLA-Restaurante Caracas
10257 HILARION-Abastos San Cristóbal
Count : 46
There were 830 orders on this report.
Page 27 of 27