12-03-2010 03:14 PM
Hi Folks,
I'm trying to put graphs into a Word template document using the Report Generation Toolkit (Labview 8.6.1) at various bookmarks. I then want to format them (as you do).
The problem is that I don't know beforehand the order of the graphs. Thus, when I insert a graph at a bookmark and try to format it, only the last graph in the document is formatted. If I try to use the Graph Index to point to the graph I've just inserted, I have to know what the index of the graph in the document is, but I don't know that. I can get back the character position before the graph and after the graph when I insert it but I can't see any way of using that to find the graph index or reference the graph.
Surely there must be a way of capturing the identity of a graph when I insert it so that I can then work with it, so what am I missing? Anyone help me?
Cheers
Huub
12-05-2010 06:59 PM
Perhaps you should work out the order of the graphs.
12-05-2010 07:46 PM
Ahh, but the idea is that the user has control of the order of the graphs by placing the bookmarks into their own template file. Moreover, they might decide to put a company logo or something either before or after the graphs. Either of these would stuff up the Graph Index.
Surely there must be SOME way of tying the position of the graph that you insert with the position of the graph that you are formatting. It seems such a basic requirement that I'm hard-pressed to see why it isn't obvious/possible.
12-05-2010 09:22 PM - edited 12-05-2010 09:23 PM
I'm sure you can do anything with LV. It's whether you can do it with the RG toolkit is another question. I'm not sure if you'll find too many gurus here in RG toolkit; if you've found that it can't be done using the VIs provided then that's probably the case.
Why don't you do it the other way around. Provide the template with bookmarks then they can build the report around your formatted graphs.
12-06-2010 01:33 PM
Huub,
One of the ideas behind the Report Generation Toolkit is that you want a way of exporting what you know into a report. Many users have figured out ways of using the RG toolkit in more interactive ways (like editing documents that have already been saved) but in general it is there to generate a report from what you know in a VI. With that in mind the way I would solve this issue would be to create a way of keeping track of the indices as others have suggested.
I would do this by use of a Functional Global Variable or what some have called Action Engines. The FGV could set, get, and clear an array of enums which would be the indices list.
I hope this helps and good luck.
12-06-2010 02:05 PM
Hi Ben,
Yes, I've used FGVs often (although I've never known that they are referred to as FGVs) but in this case I can't make use of one because there is no way to find out the Graph Index of a graph. If I know the layout of the template, including where all the bookmarks, pictures and graphs are, I then don't need an FGV. If I don't know the layout of the template then I can't use an FGV because I don't know the relationship between the bookmarks, pictures and graphs and therefore can't keep track of anything.
I hear what you're saying about the RGT but it strikes me that to output the Graph Index from the Insert Graph VI would have been a simple, logical thing to include.
I will investigate further using the Update Graph VI instead and see if there is some characteristic of the graphic that Labview can get a hold of that I can use to identify the graphs.
Thanks for your help guys. If nothing else you have provided clarity to the situation so I'm not stumbling about trying to do something that can't be done in that way. :manhappy:
regards
Huub