 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
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 |
 |
 |
 |
10323 |
 |
Königlich Essen |
 |
Brandenburg |
 |
 |
 |
10312 |
 |
Die Wandernde Kuh |
 |
Stuttgart |
 |
 |
 |
10313 |
 |
QUICK-Stop |
 |
Cunewalde |
 |
 |
 |
10301 |
 |
Die Wandernde Kuh |
 |
Stuttgart |
 |
 |
 |
10286 |
 |
QUICK-Stop |
 |
Cunewalde |
 |
 |
 |
10284 |
 |
Lehmanns Marktstand |
 |
Frankfurt a.M. |
 |
 |
 |
10285 |
 |
QUICK-Stop |
 |
Cunewalde |
 |
 |
 |
10279 |
 |
Lehmanns Marktstand |
 |
Frankfurt a.M. |
 |
 |
 |
10277 |
 |
Morgenstern Gesundkost |
 |
Leipzig |
 |
 |
 |
10273 |
 |
QUICK-Stop |
 |
Cunewalde |
 |
 |
 |
10267 |
 |
Frankenversand |
 |
München |
 |
 |
 |
10260 |
 |
Ottilies Käseladen |
 |
Köln |
 |
 |
 |
10249 |
 |
Toms Spezialitäten |
 |
Münster |
 |
 |
 |
 |
 |
Count : |
122 |
 |
 |
 |
Countries Starting With Letter : |
I |
 |
 |
 |
10. Ireland |
 |
 |
 |
 |
 |
 |
11063 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10985 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10912 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10897 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10736 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10712 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10701 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10687 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10661 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10646 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10567 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10516 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10503 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10429 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10380 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10373 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10335 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
 |
 |
 |
 |
Page 14 of |
27 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
ID |
Name |
City |
 |
 |
 |
10309 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
10298 |
 |
Hungry Owl All-Night Grocers |
 |
Cork |
 |
 |
 |
 |
 |
Count : |
19 |
 |
 |
 |
11. Italy |
 |
 |
 |
 |
 |
 |
11062 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
11060 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
11026 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
11010 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10950 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10942 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10939 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10908 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10818 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10812 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10807 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
10784 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10754 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10753 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
10727 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10710 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
10655 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10635 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10586 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10562 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10467 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10443 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10428 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10422 |
 |
Franchi S.p.A. |
 |
Torino |
 |
 |
 |
10404 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10300 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
10288 |
 |
Reggiani Caseifici |
 |
Reggio Emilia |
 |
 |
 |
10275 |
 |
Magazzini Alimentari Riuniti |
 |
Bergamo |
 |
 |
 |
 |
 |
Count : |
28 |
 |
 |
 |
 |
 |
 |
 |
Page 15 of |
27 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
ID |
Name |
City |
 |
 |
 |
Countries Starting With Letter : |
M |
 |
 |
 |
12. Mexico |
 |
 |
 |
 |
 |
 |
11073 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
11069 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10995 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
10926 |
 |
Ana Trujillo Emparedados y helados |
 |
México D.F. |
 |
 |
 |
10915 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10856 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10842 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10759 |
 |
Ana Trujillo Emparedados y helados |
 |
México D.F. |
 |
 |
 |
10682 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10676 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10677 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10625 |
 |
Ana Trujillo Emparedados y helados |
 |
México D.F. |
 |
 |
 |
10576 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10573 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10535 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10518 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10507 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10502 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
10474 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
10365 |
 |
Antonio Moreno Taquería |
 |
México D.F. |
 |
 |
 |
10354 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
10322 |
 |
Pericles Comidas clásicas |
 |
México D.F. |
 |
 |
 |
10319 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10308 |
 |
Ana Trujillo Emparedados y helados |
 |
México D.F. |
 |
 |
 |
10304 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10293 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10276 |
 |
Tortuga Restaurante |
 |
México D.F. |
 |
 |
 |
10259 |
 |
Centro comercial Moctezuma |
 |
México D.F. |
 |
 |
 |
 |
 |
Count : |
28 |
 |
 |
 |
 |
 |
 |
 |
Page 16 of |
27 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
ID |
Name |
City |
 |
 |
 |
Countries Starting With Letter : |
N |
 |
 |
 |
13. Norway |
 |
 |
 |
 |
 |
 |
11015 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
10909 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
10831 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
10639 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
10520 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
10387 |
 |
Santé Gourmet |
 |
Stavern |
 |
 |
 |
 |
 |
Count : |
6 |
 |
 |
 |
Countries Starting With Letter : |
P |
 |
 |
 |
14. Poland |
 |
 |
 |
 |
 |
 |
11044 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10998 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10906 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10870 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10792 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10611 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
10374 |
 |
Wolski Zajazd |
 |
Warszawa |
 |
 |
 |
 |
 |
Count : |
7 |
 |
 |
 |
15. Portugal |
 |
 |
 |
 |
 |
 |
11007 |
 |
Princesa Isabel Vinhos |
 |
Lisboa |
 |
 |
 |
10963 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10664 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10604 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10551 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10491 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10477 |
 |
Princesa Isabel Vinhos |
 |
Lisboa |
 |
 |
 |
10464 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10433 |
 |
Princesa Isabel Vinhos |
 |
Lisboa |
 |
 |
 |
10397 |
 |
Princesa Isabel Vinhos |
 |
Lisboa |
 |
 |
 |
10352 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
10336 |
 |
Princesa Isabel Vinhos |
 |
Lisboa |
 |
 |
 |
10328 |
 |
Furia Bacalhau e Frutos do Mar |
 |
Lisboa |
 |
 |
 |
 |
 |
 |
 |
Page 17 of |
27 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
ID |
Name |
City |
 |
 |
 |
10482 |
 |
Lazy K Kountry Store |
 |
Walla Walla |
 |
 |
 |
10483 |
 |
White Clover Markets |
 |
Seattle |
 |
 |
 |
10479 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10469 |
 |
White Clover Markets |
 |
Seattle |
 |
 |
 |
10452 |
 |
Save-a-lot Markets |
 |
Boise |
 |
 |
 |
10440 |
 |
Save-a-lot Markets |
 |
Boise |
 |
 |
 |
10441 |
 |
Old World Delicatessen |
 |
Anchorage |
 |
 |
 |
10432 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10415 |
 |
Hungry Coyote Import Store |
 |
Elgin |
 |
 |
 |
10401 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10398 |
 |
Save-a-lot Markets |
 |
Boise |
 |
 |
 |
10394 |
 |
Hungry Coyote Import Store |
 |
Elgin |
 |
 |
 |
10393 |
 |
Save-a-lot Markets |
 |
Boise |
 |
 |
 |
10385 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10375 |
 |
Hungry Coyote Import Store |
 |
Elgin |
 |
 |
 |
10369 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10349 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10346 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10344 |
 |
White Clover Markets |
 |
Seattle |
 |
 |
 |
10338 |
 |
Old World Delicatessen |
 |
Anchorage |
 |
 |
 |
10329 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10324 |
 |
Save-a-lot Markets |
 |
Boise |
 |
 |
 |
10316 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10317 |
 |
Lonesome Pine Restaurant |
 |
Portland |
 |
 |
 |
10314 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10310 |
 |
The Big Cheese |
 |
Portland |
 |
 |
 |
10307 |
 |
Lonesome Pine Restaurant |
 |
Portland |
 |
 |
 |
10305 |
 |
Old World Delicatessen |
 |
Anchorage |
 |
 |
 |
10294 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10272 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
10271 |
 |
Split Rail Beer & Ale |
 |
Lander |
 |
 |
 |
10269 |
 |
White Clover Markets |
 |
Seattle |
 |
 |
 |
10262 |
 |
Rattlesnake Canyon Grocery |
 |
Albuquerque |
 |
 |
 |
 |
 |
Count : |
122 |
 |
 |
 |
 |
 |
 |
 |
Page 25 of |
27 |
 |
 |