02-09-2022 04:23 AM
Hi,
I am using the report generation toolkit and I can generate the report (.doc).
I want to be able to append to the same .doc, but the .doc will be replaced when I run another vi to write to the .doc.
Both vi have the similar part:
How can I append to .doc if it already exists?
Solved! Go to Solution.
02-09-2022 04:32 AM
Hello,
In your pictures you are creating two documents that fortunately have the the same and then are remplacing each other.
To write in the same one you will need to open a template with the good path at your "create report" function.
02-09-2022 08:33 PM
Thanks for your reply!
02-10-2022 12:51 AM
I still do not understand the process.
If I create a report with template as follows in one vi, and write to it.
How the second vi write to the same report?
1. It create a report again and write to it?
or
2. It need to get the "report out" created by the first vi?
If it needs to get the "report out" created by the first vi, how to transfer it from the first vi to the second vi?
By global variable?
I assume the "save to file" can only be used once after all data have been written.
02-10-2022 01:32 AM
When using a template the file must at least already existing even if empty. Then it depends of your dataflow.
- If both your actions have to be able to write at the same time, then you need to share the "report out" between your sub-action / sub -vi. Create your report well before and then distribute the "report out" value to your sub-vi by a wire, cluster, etc... Beware race conditions.
- If your actions are writing at a specific moment ==> you can open the template, add some data, save and close the report then repeat elsewhere. If you file as a new filename, just use that new filename as template for the next "Create report".
02-10-2022 01:54 AM
Thanks for your reply.
The two vis will not write to the report at the same. They are sequential.
The template is not empty, it also has some bookmarks.
"- If your actions are writing at a specific moment ==> you can open the template, add some data, save and close the report then repeat elsewhere. If you file as a new filename, just use that new filename as template for the next "Create report"."
I understand your process:
In the first vi: create vi -> write data -> close the report.
In the second vi: create vi -> write some other data -> close the report.
At last "save the report to file".
How to close the report?
In the second vi, create vi using the same template, the report will be the same report as the first vi?
Finally, all data inserted from the first vi and the second vi should be in the same .doc file.
02-10-2022 02:08 AM
The process is always : create vi -> write data -> save =>close the report.
If not saving your data are lost at the closing action.
The close report function is that one and below an example.
02-10-2022 02:47 AM
Thank you very much!
Your example vi is very useful!
Now I know the trick is:
The first vi save to a .doc file, the second vi use the .doc file as a template!