Writing an Excel file with a dynamic number of sheets
When you generate an Excel file, you usually generate it with a single sheet. You can however generate a file with more sheets. With PDI, you can generate an Excel file with several sheets even if you don't know in advance how many sheets you will generate, or the name of those sheets.
In this recipe, you will create such an Excel file. Your file will have book title information separated in different sheets depending of the genre of the books.
Getting ready
You will need a database containing books and authors with the structure described in Appendix, Data Structures.
How to do it...
Carry out the following steps:
Create a new job.
From the File Management category, drop a Delete file job entry into the work area.
In the File name textbox, type the path and name of the Excel file you will create, in order to remove the file if it exists.
Then you have to add two Transformation entries: one for selecting the book's categories (
Transf_Categories...