Skip to main content
Solved

Excel Writer


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.

Best answer by erik_jan

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.

View original
Did this help you find an answer to your question?

4 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Best Answer
  • November 7, 2016

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.


itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • November 7, 2016

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.


  • Author
  • November 8, 2016
erik_jan wrote:

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.

itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • November 8, 2016
jimq66 wrote:
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"

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings