Skip to main content

I am trying time entry from a SQL table to Excel to be imported into our time entry software. I want to create one worksheet that contains all employee entries and then an individual worksheet for each employee in the same workbook. I can get it to do one or the other but not both at the same time. SO far I know if I define the sheet name - Time Entry - I can write all the data to one sheet. Or if I set the sheet name to - Employee Name - I get the individual sheets for each employee. I have tried coping the writer and defining the sheet name both ways but that doesn't work.

You should not copy the writer, but create two feature types on the same writer instead.

One feature type will be called Time_Entry (no spaces allowed as far as I know), one will have the Employee name attribute defining the name of the feature type.

Then write all features to both feature types.


essentially you were on the right track, one feature type (a sheet in xls) defined to hold all the information and a second writer feature type (e.i more xls sheets) that uses the name as a feature fan out. This wil result in a sheet per name.


You should not copy the writer, but create two feature types on the same writer instead.

One feature type will be called Time_Entry (no spaces allowed as far as I know), one will have the Employee name attribute defining the name of the feature type.

Then write all features to both feature types.

This works but it leads to another question @erik_jan @itay . I have the Drop/Truncate for both writers set to YES for Drop Existing Sheet/Named Range and Truncate Existing Sheet/Named Range. When I run this with a date range that I would expect to drop some of the employee sheets it updates the ones that need to be updated and recreates the sheet containing everyone but does not drop the sheets that should be dropped. Any thoughts on this.
This works but it leads to another question @erik_jan @itay . I have the Drop/Truncate for both writers set to YES for Drop Existing Sheet/Named Range and Truncate Existing Sheet/Named Range. When I run this with a date range that I would expect to drop some of the employee sheets it updates the ones that need to be updated and recreates the sheet containing everyone but does not drop the sheets that should be dropped. Any thoughts on this.
I would choose one of the options Drop OR truncate and not both and next to that I dont really understand waht you mean by

 

"When I run this with a date range that I would expect to drop some of the employee sheets it updates the ones that need to be updated and recreates the sheet containing everyone but does not drop the sheets that should be dropped"

Reply