Showing results for 
Search instead for 
Did you mean: 

How can I save images and text data to the same file?

I have been looking at ways to do this for a while. My main VI saves the raw data to a text file which the users then import to Excel and plot. I am trying to simplify this process and have been looking at ways to accomplish this task. I want to be able to save the raw data to a file and then save the Labview graph as well. This will eliminate the tedious task of importing the raw data into Excel and plotting it. I can save the raw data to its own file and I can use the Get Image method for the graph and save it to its own file. I am currently using the .png format. Is there a way of saving both to the same file ie, importing the image into Excel or Word etc. Before I go off doing a science project I wanted to see if anyone else had experience completing this task and had any recommendations. Thanks in advance for any help.
0 Kudos
Message 1 of 16
Yes, you can do it. If you have the Report Generation toolkit, I believe it would simplify things. However you can do it with ActiveX calls to the Excel API. You could even use ActiveX to import the data and generate the graph in Excel if you wanted to. You'd have to do some searching for how to use ActiveX if you've never used it. If you need it, I can put together a simple example to get you started.
0 Kudos
Message 2 of 16


I have the full version which does have the report generation tools, if that is what you are considering the tool kit. I have been through the training and understand how the activeX works but have not had to use it, until now I have a feeling. If you could throw together an example to give me an idea of the process that would be greatly appreciated.




0 Kudos
Message 3 of 16

Well the report generation VIs that come with it are different. The toolkit interacts with MS Office to create reports. I haven't used it, but I'm pretty sure it does exactly what you want. You can do everything it does with ActiveX calls though. I'll throw together something that shows how to open Excel and get things started. I've only used Word extensively, but Excel can't be too much different.

What version of LabVIEW do you have?

Message Edited by Marc A on 01-09-2007 09:25 AM

0 Kudos
Message 4 of 16

well ther are a couple of ways. You could use the standard report generation VI's and make a complete report with the image of the graph embedded into the report with the raw data or you could use activeX and control excel thru LV and put the raw data into excel directly and have excel graph the data without any user interaction. I have posted a slew of VI's on the excel board if you do not have the report generation toolkit. If you could tell me which way you want to go I could possibly send you an example.



For more information and some sample VI's and tool kits, you can go to the excel board

0 Kudos
Message 5 of 16
I would prefer the way that would be most scaleable being that I would not be doing this for only one VI. Any examples would be appreciated being that I have never done this type of report generation before. To date I have just been saving raw data to text files.
0 Kudos
Message 6 of 16

Looks like Joe has a lot more experience with Excel, so I would suggest going to look at what he has. ActiveX is what you want for the greatest amount of flexibility. I have a set of Word VIs that I use in several projects when I need to create reports.

Of course you could always just pony up the cash to NI to get the Office Report Generation toolkit if you don't want to bother writing everything yourself.

0 Kudos
Message 7 of 16

OK here is my take on this.

Excel is great for this and there is an entire toolset on the excel board with lots of examples. but if there is not a huge amount of data then just use the regular standard report tools and embed the image of the graph into it. Have a look at the example called example html and sample test

But if you insist on using activeX for excel then have a look at the excel board and I will try to provide you with an example later.

For more information and some sample VI's and tool kits, you can go to the excel board

0 Kudos
Message 8 of 16


Thanks for all the help. I actually download your Excel VIs a couple of days ago taking a look at what you have done. I have then on my functions pallete. Anyway I will take a look at the report generation VI as you have suggested and see what I can do. I do not have to use Excel, it was just what I have been using for the raw data and plotting to date.

0 Kudos
Message 9 of 16
The problem with using the report generation VIs to create an html report is that the image file will need to be separate anyway. The original question was how to put it into the same file with the data. Using an Excel spreadsheet, or even a Word document for that matter, allows you to save the image in the file.
0 Kudos
Message 10 of 16