To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This is an example that fulfills the function of saving Word or Excel report as a PDF.
Description
This VI demonstrates how to use ActiveX methods to save a Word or Excel report as a PDF. This can be useful for generating reports that cannot be edited by the end-viewer. This VI saves the file as "LabVIEW Save.pdf" in the same directory as the source report. You could easily modify this VI to be used as a subVI with the file name of your choice.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This is fantastic. Just tried it out once, and seems working. This is solving a huge problem for me. It should be addad to the report generation toolkit. And you should get a fat bonus 🙂 Thanks for posting this!
Martin
Hi
I just stared to use this as well and it works perfect. However what is the required installations to run this? It works fine for me with Win7, LV2012 and office 2010. However when I build an *.exe and tried to run it on a WinXP and office 2003 my program crashes when it tries to make a word file to a pdf.
Any suggestions?
Regards
/Martin
Hi Martin,
There are a number of reasons this could happen. If you create a post on the LabVIEW discussion forums, I'm sure you'll get some help. Without more details of the crash you're getting, I would guess that the problem is due to one of two things:
1) not including the libraries in your exe build (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019O6PSAU&l=en-US)
2) The report gen toolkit uses a lot of ActiveX to interface with MS Office. Microsoft may have changed the ActiveX calls between 2003 and 2007. You'll need to test the exe on a computer with Office 2010.
Hi,
It is really good. Can anyone tell me how to convert this to use in LabWindows.
-Rajan
using this method we will be able to generate reports and edit in a simpler way.i am not getting any crashes when save word to pdf c# using labview. so the above problem can be find in the forum.
hope there are more features in the future.
can anyone tell me how to create VI that saves a file in PDF format plz...
chetuchetan, you should try posting your question on the forums:
https://forums.ni.com/t5/LabVIEW/bd-p/170
Cheers!
Hi,
How to save html report as a PDF using report generation tool kit and ActiveX.
- Nick
Hello, and thanks for the post on this! Has anyone encountered an issue when using this to convert TestStand generated HTML reports to PDF (using the MSWord case)? This code converts the html to PDF perfectly, except I cannot seem to get it to render the graphs correctly. When I open the HTML in internet explorer, I see the graph after allowing the ActiveX control to run that creates the graph (it's installed with TestStand).
If anyone has a workaround for this, I would really appreciate it. Can this be done using MSWord like this?
I would suggest you post this question on the discussion forums (ni.com/forums). You'll get a much better response there. Cheers!
Hi,
I use this VI and it runs very good.
My problem is that I have a Excel sheet with 6 spreadsheet and on this spreadsheet I use a printarea.
[PrintArea]
1="$A$1:$H$63"
2="$D$1:$K$54"
3="$A$1:$H$54"
4="$A$1:$H$63"
5="$A$1:$H$54"
6="$A$1:$H$54"
I will save this excelfile in a PDF (using the printarea) ! If anyone has a workaround !
2016-08-29. In the German Excel (Active X) is a BUG that the VI did not runs right. In the english version of Excel will be ok.
Hi, do you know the way to convert many the same(duplicated) .xls file to one pdf. (every .xls respond one .pdf ) ?
Thanks for help!
Hi,
Readout the folder where the excelfiles are be, open all files and copy all spreadsheeds in ONE excelfile. Than use the this vi for changing this excelfile in PDF.
This VI is working in one PC, but when I try to run it on other PC(LabVIEW 2012, MS Office 2007, WIN7 Pro), it is showing error -2147024809, The parameter is incorrect,(one or more arguments are invalid), I reinstalled RGT toolkit but same error is coming.
hi this solution is working fine on the system where i have generated the code, but when i have created installer and inatalled the same on oter PC there is was not working can you please help me to resolve this problem.
This VI is working in one PC, but when I try to run it on other PC(LabVIEW 2012, MS Office 2007, WIN7 Pro), it is showing error -2147024809, The parameter is incorrect,(one or more arguments are invalid), I reinstalled RGT toolkit but same error is coming.
Solution- You need to install add-on:- Microsoft Office Add-in: Microsoft Save as PDF or XPS