question

gilbert jerald avatar image
0 Likes"
gilbert jerald asked gilbert jerald commented

Excel export error?

Hi

The key thing which i am expecting is. How to export the output results into excel without clearing the previous exported results in the same excel sheet.

The problem here is when i try to export the new results, the old exported results remains unchanged. so this problem let me to create a new excel every time when i try to export different results. Is there any way to overcome this problem. Your answer is very much useful.

Thank you.

FlexSim 18.0.1
excel export
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeff Nordgren avatar image Jeff Nordgren commented ·
@gilbert jerald

Could you send us your model and a description of exactly how you are now trying to do it? Are you doing several manual runs of the model? Are you using the Experimenter? It would help to understand how you are trying to do this and what you need to end up with. A model would certainly help.

Thanks.

0 Likes 0 ·
gilbert jerald avatar image gilbert jerald Jeff Nordgren commented ·

@ Jeff Nordgren

Thanks for your reply. I have attached the sample model for your better understanding of my problem.

I have attached two models

1) Excel Sample Model_1

2) Excel Sample Model_2

In this, the first model global table consists of 4 rows 5 columns and this table consist of value that needs to be exported to excel (Book_1) sheet1

In the second model global table consists of 3 rows 4 columns and this table consist of some value that needs to be exported into the same excel (Book_1) sheet1

The problem which I am facing is when I export the first model global table values (4 rows 5 columns) into an empty excel (Book_1) Sheet1. The excel print the value associated with the first model global table (4 rows 5 columns)

and now when I try to export the second model global table values (3 rows 4 columns) into same the same excel (Book_1)Sheet1. The excel print the value associated with the second model global table but the previously exported data in excel 4th row 5th column values are not getting deleted.I want only the value associated with the second model to be printed. How to over come this problem.

The bellow pic will explain the above statement

2)

Below i have attached the model for your reference have a look at it.

excel-sample-model-1.fsmexcel-sample-model-2.fsmbook1.zip

Thank you.

0 Likes 0 ·
book1.zip (5.6 KiB)
model-1.png (91.9 KiB)
model-excel-1.png (84.9 KiB)
model-2.png (92.8 KiB)
model-excel-2.png (84.1 KiB)

1 Answer

·
Matt Long avatar image
2 Likes"
Matt Long answered gilbert jerald commented

All you need to do is make your second table 4 x 5 with the 4th row and 5th column being empty. This will ensure that those cells are cleared when you do the second export. Use string data in those empty cells so they don't export 0's into your excel sheet.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

gilbert jerald avatar image gilbert jerald commented ·
@ Matt Long

Hi,

Thanks for your reply. I understand your answer. But the model which I have attached you is just a sample model, in my original model, the model doesn't know how many rows will be generated. only at the end of the model only we can know how many rows have been generated.Because I have used Add row to the global table command, So in my case, I don't know how many rows this command is going to write on the global table.

Thank You

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel gilbert jerald commented ·

You know the number of rows and columns you updated the time before. You use this data to clear the table and update the values. On Reset you open an empty excel file that you rename in the system.

0 Likes 0 ·
gilbert jerald avatar image gilbert jerald Joerg Vogel commented ·

I have tested your idea but I can achieve this by manually clearing the data where else I need the data in excel to be cleared through code from flexsim model is there any way to help me.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.