Skip to main content
Question

I need to write to a single excel file with multiple sheets using a template. I've created a template with multiple sheets formatted as I need them but when I write to excel, it will only write one of the sheets and leave the others blank.

  • September 22, 2021
  • 6 replies
  • 572 views

mcannalea12
Contributor
Forum|alt.badge.img+2
I need to write to a single excel file with multiple sheets using a template. I've created a template with multiple sheets formatted as I need them but when I write to excel, it will only write one of the sheets and leave the others blank.

6 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • September 22, 2021

Hi @mcannalea12​ did you configure the option in the writer Sheet Name:

 

Output_Excel 

Thanks in Advance,

Danilo

 

 


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • September 22, 2021
danilo_fme wrote:

Hi @mcannalea12​ did you configure the option in the writer Sheet Name:

 

Output_Excel 

Thanks in Advance,

Danilo

 

 

I changed the Sheet Names to match the corresponding template sheet name. So in the template excel file, I have Sheet 1 and Sheet 2. Then in the workbench I created a writer to write ExcelFile.xlsx and the Sheet Name is set to Sheet 1. Then I have a second writer, still writing to ExcelFile.xlsx but Sheet Name is changed to Sheet 2. It seems Sheet 1 will populate just fine but then Sheet 2 is blank.


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • September 22, 2021
mcannalea12 wrote:

I changed the Sheet Names to match the corresponding template sheet name. So in the template excel file, I have Sheet 1 and Sheet 2. Then in the workbench I created a writer to write ExcelFile.xlsx and the Sheet Name is set to Sheet 1. Then I have a second writer, still writing to ExcelFile.xlsx but Sheet Name is changed to Sheet 2. It seems Sheet 1 will populate just fine but then Sheet 2 is blank.

Could you share your workspace and data?​


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • September 22, 2021
mcannalea12 wrote:

I changed the Sheet Names to match the corresponding template sheet name. So in the template excel file, I have Sheet 1 and Sheet 2. Then in the workbench I created a writer to write ExcelFile.xlsx and the Sheet Name is set to Sheet 1. Then I have a second writer, still writing to ExcelFile.xlsx but Sheet Name is changed to Sheet 2. It seems Sheet 1 will populate just fine but then Sheet 2 is blank.

Forgot to include all the documents in my first reply. This is sensitive data, so I've stripped everything out except a single row of informatoin.


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • September 24, 2021

Hi @mcannalea12​ 

Based on the workspace, you're seeing this behaviour because you have two Excel writers writing to the same file. When both writers are creating the same file, the first file created is overwritten by the second writer and you see only the results of the last Excel writer that runs.

Add a feature type for one of the Excel writers and delete the other writer to avoid overwriting. I hope this helps.


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • September 30, 2021
debbiatsafe wrote:

Hi @mcannalea12​ 

Based on the workspace, you're seeing this behaviour because you have two Excel writers writing to the same file. When both writers are creating the same file, the first file created is overwritten by the second writer and you see only the results of the last Excel writer that runs.

Add a feature type for one of the Excel writers and delete the other writer to avoid overwriting. I hope this helps.

Yes, thank you, that fixed it! I knew it must be something really simple I was missing!


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