LabVIEW Report Generation Toolkit for Microsoft Office User Guide



Similar documents
LabVIEW Report Generation Toolkit for Microsoft Office

Report Generation Toolkit for Microsoft Office User Manual

Getting Started with the LabVIEW Mobile Module

Getting Started with the LabVIEW Mobile Module Version 2009

Getting Started Manual

Coupling Microsoft Visio with NI Requirements Gateway

LabVIEW Internet Toolkit User Guide

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

EET 310 Programming Tools

LabVIEW DSP Test Integration Toolkit for TI DSP

Word 2010: Mail Merge to with Attachments

LABVIEW DSP TEST TOOLKIT FOR TI DSP

Create a New Database in Access 2010

Excel 2013 What s New. Introduction. Modified Backstage View. Viewing the Backstage. Process Summary Introduction. Modified Backstage View

Working together with Word, Excel and PowerPoint

Coupling Microsoft Excel with NI Requirements Gateway

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

Chapter 11 Compound Documents in Windows 3.1

How To Create A Report In Excel

MicroStrategy Desktop

MS WORD 2007 (PC) Macros and Track Changes Please note the latest Macintosh version of MS Word does not have Macros.

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Microsoft Access 2007

Database Forms and Reports Tutorial

Generating a Custom Bill of Materials

Advanced Presentation Features and Animation

Adobe Conversion Settings in Word. Section 508: Why comply?

Search help. More on Office.com: images templates

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

Mail Merge Creating Mailing Labels 3/23/2011

How to use MS Excel to regenerate a report from the Report Editor

Appendix A How to create a data-sharing lab

WHAT S NEW IN MS EXCEL 2013

HTML Templates Guide April 2014

Microsoft Office PowerPoint Creating a new presentation from a design template. Creating a new presentation from a design template

Sage Accpac ERP 5.6A. CRM Analytics for SageCRM I User Guide

This document details the following four steps in setting up a Web Server (aka Internet Information Services -IIS) on Windows XP:

Lab View with crio Tutorial. Control System Design Feb. 14, 2006

Use the Microsoft Office Word Add-In to Create a Source Document Template for Microsoft Dynamics AX 2012 WHITEPAPER

Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.

LabVIEW Day 6: Saving Files and Making Sub vis

TIBCO Spotfire Automation Services 6.5. User s Manual

Advanced Excel 10/20/2011 1

Excel Reports and Macros

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Page Create and Manage a Presentation 1.1 Create a Presentation Pages Where Covered

The first thing to do is choose if you are creating a mail merge for printing or an merge for distribution over .

Ansur Test Executive. Users Manual

1.5 MONITOR. Schools Accountancy Team INTRODUCTION

Introduction to Microsoft Access 2007

MICROSOFT WORD: MAIL MERGE

You must have at least Editor access to your own mail database to run archiving.

Automate tasks with Visual Basic macros

NETWORK SOFTWARE DOCUMENTATION N Rev Q

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

Virtual Communities Operations Manual

Sample. LabVIEW TM Core 1 Course Manual. Course Software Version 2010 August 2010 Edition Part Number B-01

Microsoft Office PowerPoint 2013

HOW TO CREATE AN HTML5 JEOPARDY- STYLE GAME IN CAPTIVATE

WebSphere Business Monitor

Working with Macros and VBA in Excel 2007

MICROSOFT EXCEL 2011 MANAGE WORKBOOKS

Results CRM 2012 User Manual

Scribe Online Integration Services (IS) Tutorial

Microsoft Dynamics GP. Extender User s Guide

ODBC Driver Version 4 Manual

-SoftChalk LessonBuilder-

Google Sites: Site Creation and Home Page Design

Creating a Table of Contents in Microsoft Word 2011

Quick Start Guide. Highly customizable automated trading Automate your trades according to rules and models you create.

Skills Funding Agency

National RTAP Marketing Transit Toolkit Customizing Templates in Microsoft Publisher

Practice Fusion API Client Installation Guide for Windows

Adobe Acrobat 9 Pro Accessibility Guide: Creating Accessible PDF from Microsoft Word

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

Smart Web. User Guide. Amcom Software, Inc.

Custom Reporting System User Guide

Microsoft Excel 2013: Macro to apply Custom Margins, Titles, Gridlines, Autofit Width & Add Macro to Quick Access Toolbar & How to Delete a Macro.

Construction Administrators Work Smart with Excel Programming and Functions. OTEC 2014 Session 78 Robert Henry

Microsoft Office Access 2007 Basics

Microsoft Access 2007 Advanced Queries

Introduction to Microsoft Access 2003

Crystal Reports Designer Version 10

Umbraco v4 Editors Manual

Excel macros made easy

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Create Mailing Labels from an Electronic File

Q&As: Microsoft Excel 2013: Chapter 2

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

Task Force on Technology / EXCEL

Microsoft Publisher 2010 What s New!

Introduction to Microsoft Access 2010

Excel & Visual Basic for Applications (VBA)

Software User's Guide

Maximizing the Use of Slide Masters to Make Global Changes in PowerPoint

Toad for Data Analysts, Tips n Tricks

LabVIEWTM. LabVIEW Fundamentals. LabVIEW Fundamentals. August C-01

Building A Very Simple Web Site

Importing from Tab-Delimited Files

Transcription:

LabVIEW Report Generation Toolkit for Microsoft Office User Guide Version 1.1 Contents The LabVIEW Report Generation Toolkit for Microsoft Office provides tools you can use to create and edit reports in Microsoft Word and Excel formats from LabVIEW. The Report Generation Toolkit modifies the VIs on the Report Generation palette in LabVIEW Full and Professional Development Systems to support Word and Excel formats in addition to HTML and standard LabVIEW report formats. The toolkit also adds palettes of Word-specific and Excel-specific VIs to the Report Generation palette. You can use the Report Generation Toolkit with the LabVIEW Base Package. You can use Report Generation Toolkit VIs to perform the following tasks: Create and edit Word documents and Excel worksheets. Use Word and Excel templates to create reports with a consistent, uniform style. Insert, format, and edit text, tables, images, and graphs within Word documents and Excel worksheets. Report Generation Toolkit VIs can handle several Word documents at the same time or several Excel worksheets in the same workbook. Run Microsoft Visual Basic for Applications macros from Word documents and Excel workbooks. Upgrading from Report Generation Toolkit 1.0.x... 2 Selecting Report Types... 3 Using Report Generation Express VIs... 3 Using the Report Express VI... 3 Using the MS Office Report Express VI with Word and Excel Templates... 4 Using Graphs in Reports... 5 LabVIEW, National Instruments, NI, and ni.com are trademarks of National Instruments Corporation. Product and company names mentioned herein are trademarks or trade names of their respective companies. For patents covering National Instruments products, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your CD, or ni.com/patents. March 2004 323805A-01 ni.com 2004 National Instruments Corp. All rights reserved.

Creating Custom Templates...6 Creating Bookmarks in Word...6 Creating Named Ranges in Excel...7 Running Visual Basic Macros in Word and Excel...7 Creating Stand-Alone Applications...9 Related Documentation...10 Upgrading from Report Generation Toolkit 1.0.x The Report Generation Toolkit 1.1 contains the following changes from the Report Generation Toolkit 1.0.x: You can use the Report Generation Toolkit with Office 2003 as well as Office 2000, XP, and 97. The Report Generation Toolkit runs only with LabVIEW 7.0 or later. Use the MS Office Report Express VI to generate reports using Word and Excel templates. The VIs on the Report Generation palette reflect the following changes made to the corresponding VIs in LabVIEW 7.0: Use the Report Express VI to generate preformatted reports. Use the Easy Print VI Panel or Documentation VI to print or save front panels and VI documentation. Use the VIs on the VI Documentation palette to customize VI documentation that you print or save to a report. Use the Query Available Printers VI to list the printers available on the computer, including the default printer in LabVIEW. Use the Print Report VI to print a Word, Excel, or standard report to the default printer. The Append Front Panel Image to Report VI is polymorphic. You can wire a path, VI reference, or string to the VI to specify which front panel to append to a report. The Append Table to Report VI is polymorphic and has instances that replace the Append Text Table to Report VI and the Append Numeric Table Report VI. Use the Excel Set Page Numbering VI to add and format page numbers in an Excel worksheet. The Word VI Template and Excel VI Template VIs no longer appear on the palettes, but you still can access them from LLBs. LabVIEW Report Generation Toolkit 2 ni.com

Selecting Report Types When you create a report in LabVIEW, you must decide which type of report you want. Consider whether you need to print, save, or email the report, and whether you want to use a template to create the report. You also should consider the applications that are available on other computers from which users access the report. You can use the Report Generation Toolkit to create the following types of reports: Standard The standard LabVIEW report requires no additional software on the computer you use to create the report. You can insert text, tables, and images into a standard report. You can print a standard report, but you cannot save the report. LabVIEW supports a limited number of formatting options, and you cannot use templates. HTML HTML reports require no additional software on the computer you use to create the report. However, users need a Web browser to read the report. You can save an HTML report, but the report might not print with consistent formatting. LabVIEW supports a limited number of formatting options for HTML reports, and you cannot use templates. Word and Excel Word and Excel reports require that users who want to read or print the reports have the appropriate application on their computers. You can insert text, tables, images, and graphs into Word and Excel reports. You can save, print, and email the reports. You can set a variety of formatting options with text and tables, and you can use templates to create a consistent report style. Using Report Generation Express VIs Using the Report Express VI The Report and MS Office Report Express VIs provide easy ways to create reports in standard, HTML, Word, and Excel formats. These Express VIs appear on the Report Generation palette with white backgrounds surrounded by a blue border. When you place an Express VI on the block diagram, a configuration dialog box appears that you can use to configure the settings for that instance of the Express VI. Refer to the Getting Started with LabVIEW manual for more information about using Express VIs. The Report Express VI generates a preformatted report that contains VI documentation, data, and report properties, such as the author, company, and number of pages. You can configure the VI to print the report to a printer or to save it as an HTML, Word, or Excel file. National Instruments Corporation 3 LabVIEW Report Generation Toolkit

Using the MS Office Report Express VI with Word and Excel Templates The MS Office Report Express VI uses Word and Excel templates to create reports. Word and Excel templates contain placeholders for data and components that are common to all reports. The MS Office Report Express VI inserts data into the placeholders so you can display, print, or save the resulting report. The Report Generation Toolkit includes basic templates for Word documents and Excel worksheets. Complete the following steps to use the MS Office Report Express VI to create a report with basic templates. 1. Place the MS Office Report Express VI on the block diagram. The configuration dialog box appears. 2. Select Basic Template for Word or Basic Template for Excel from the Template control. 3. Click an entry in the Bookmarks in the Selected Template (Word) or the Named Range in the Selected Template (Excel) listbox. Each entry represents a placeholder in the template. 4. Use the Value Source control to determine whether you want to configure the selected bookmark or named range as an input, fixed value, or system-defined value. 5. If you configure the bookmark or named range as an input, use the Input Appearance in Report control to determine how you want the data to appear in the report. The default is Automatic, in which the VI formats the data as a text field or, if it is an array, as a table. If the data is in an array, you also can select the Table or Graph options. 6. Use the Report Destination control to select the method in which you want to generate the report. You can open the report in Word or Excel, print it, or save it as a Word or Excel file. If you select Save to File, click the Configure Save to File button to select the filename and location. 7. Click the OK button. The Express VI icon on the block diagram displays inputs for all bookmarks or named ranges you configured as inputs. 8. Wire data to the inputs and run the VI. The report prints, saves as a file, or opens in Word or Excel, depending on the option you selected in the Report Destination control. Use custom templates if you want to change report attributes or add placeholders. Refer to the Creating Custom Templates section for information about creating templates. LabVIEW Report Generation Toolkit 4 ni.com

Note Do not change the Report Generation Toolkit basic templates for Word and Excel. If you want to edit the basic templates, save them with different filenames and select Custom Template for Word or Custom Template for Excel in the configuration dialog box of the MS Office Report Express VI. Using Graphs in Reports The Graph and Picture VIs in the Report Generation Toolkit provide an interface to the Microsoft Graph application, which is part of the Microsoft Office package. The Microsoft Office installation must include Microsoft Graph if you want to use these VIs. When you insert graphs into reports, you must send data to the graph as a 2D array of numbers. You can send row and column headers, or values and categories, as 1D arrays of strings. Graphs can hold up to 4,000 rows and 4,000 columns including row and column headers, and they can display up to 256 data series. Graphs and images form a collection for each Word document or Excel worksheet. Each object in a collection has an index value based on the order of the objects in the document or worksheet. Index values begin at 0. For example, if an Excel report contains an image, a second image, and a graph, the index value for the graph is 2. Enter index values in the graph index or picture index inputs of the Graph and Picture VIs to specify which graph or image you want the VI to format. By default, Graph and Picture VIs apply to the last object in a collection of a document or worksheet. You can avoid confusion with collection index values by formatting graphs and images immediately after you insert them into a report. The Graph and Picture VIs support all graph types that Microsoft Graph uses. If you want to format a graph in a way that the Graph and Picture VIs do not support, insert the graph in a Word or Excel template, format the graph, and use the Word Update Graph VI or the Excel Update Graph VI to fill the graph with data. Refer to the LabVIEW Help for more information about specific Graph and Picture VIs. Refer to the examples\office directory for examples of inserting and formatting graphs in Word and Excel reports. National Instruments Corporation 5 LabVIEW Report Generation Toolkit

Creating Custom Templates Creating Bookmarks in Word You can create custom report templates in Word and Excel to ensure a consistent appearance in multiple reports. Use templates to define page size, text formatting, and other aspects of report appearance. You also can specify placeholders for text, tables, graphs, and images. Both Word and Excel provide ways to insert placeholders into documents and worksheets. Use bookmarks in Word and named ranges in Excel to define placeholders. You can use bookmarks to insert text, numbers, tables, or pictures into a Word document template. Word template filenames include the.dot extension. Complete the following steps to define a bookmark in a Word template. 1. In Word, open the report template you want to use. 2. Place the cursor in the location where you want to add a bookmark. 3. Select Insert»Bookmark. 4. Enter the bookmark name you want to use and click the Add button. To view all bookmarks in a Word template, select Tools»Options in Word. From the Options dialog box, click the View tab and place a checkmark in the Bookmarks checkbox. You can use the MS Office Report Express VI to generate reports using templates. For each bookmark, you can specify whether you want the Express VI to format data as text or, if it is an array, as a table or graph. You also can use Word-specific VIs to insert text, tables, and graphs into bookmark locations. Specify the bookmark where the VI inserts data in the MS Office parameters input. If you do not specify a bookmark, the VI inserts data at the end of the document. Use the Word Edit Cell VI to send data to a preformatted table in a template. The VI can update either individual table cells or a complete range. Use the start parameter to specify the location of the cell or range to update. Use the table index parameter to specify the location of the table to update. A value of n in the table index parameter represents the (n + 1) table of the current document. The default value of 1 represents the last table of the document. Use the Word Update Graph VI to update empty graphs in Word templates. LabVIEW Report Generation Toolkit 6 ni.com

Creating Named Ranges in Excel You can define a named range in Excel to insert text, numbers, tables, or pictures into a template. Excel template filenames include the.xlt extension. Complete the following steps to define a named range in a report template. 1. In Excel, open the report template you want to use. 2. Select the cell or the range of cells that you want to include in the named range. 3. Select Insert»Name»Define. 4. Enter the name you want to use for the named range and click the Add button. You can use the MS Office Report Express VI to generate reports using templates. For each named range, you can specify whether you want the Express VI to format data as text or, if it is an array, as a table or graph. You also can use Excel-specific VIs to insert text, tables, and graphs into named range locations. Specify the named range where the VI inserts data in the MS Office parameters input. If you do not specify a named range, the VI inserts data into the cell that the position input defines. Running Visual Basic Macros in Word and Excel You can use the Word Run Macro VI and the Excel Run Macro VI to run Visual Basic for Applications (VBA) macros in Word and Excel. The VIs can run existing VBA macros and macros that you program to implement functionality that the Report Generation Toolkit does not include. If the macro you want to run requires input arguments, enter them into the parameters input of the VI. The data type for this input is an array of variants. You must convert all the input parameters sent to the macro to variants and bundle the parameters into an array. Use the To Variant function to convert the parameters to variants. Use the Build Array function to build the parameters into an array. If you want to retrieve an output value from a macro that LabVIEW runs, you can find this value in the return value parameter of the Word Run Macro VI or the Excel Run Macro VI. The VI returns the output value as a variant. Use the Variant To Data function to convert the value to LabVIEW-compatible data. Note Word 97 does not support the ability to send data to and retrieve data from a macro. National Instruments Corporation 7 LabVIEW Report Generation Toolkit

Before running a macro, make sure you include the module that defines the macro in the VBA project associated with the report or in the template on which you based the report. If you are using a Word or Excel template, you can import the module containing the macro manually into the VBA project associated with the template. Complete the following steps to import the module manually. 1. Open the template in Word or Excel. 2. Select Tools»Macro»Visual Basic Editor. 3. In the project window of the Visual Basic editor, right-click the template and select Import File from the shortcut menu. 4. Select the file in which the macro is defined and click the OK button. The Word Import Module VI and the Excel Import Module VI can import modules dynamically from a VBA function file (.bas) or from a LabVIEW string that contains the module source code. To run a macro that manipulates objects from another application, set a reference to the application type library. This allows easy access to objects that use either the Word Add Reference to VBproj VI or the Excel Add Reference to VBproj VI. Refer to the Microsoft Visual Basic Help for more information on type libraries. The following example uses Report Generation Toolkit VIs to run a Word macro. The New Report VI creates a new Word document. The Append Table to Report VI inserts a table into the report. The Word Import Module VI adds a VBA module to the report. The Word Run Macro VI runs the ProcessTable macro that the module defines. The Word Remove Module VI deletes the module from the report. The Save Report to File VI saves the report as a Word document. The Dispose Report VI closes the Word document. LabVIEW Report Generation Toolkit 8 ni.com

Creating Stand-Alone Applications You can include Report Generation VIs when you build stand-alone applications and create shared libraries in LabVIEW. You must use the Application Builder to build stand-alone applications. Note The LabVIEW Professional Development System includes the Application Builder. If you use the LabVIEW Base or Full Development System, you can purchase the Application Builder separately by visiting the National Instruments Web site at ni.com. When building applications with Report Generation Toolkit VIs, you must complete the following additional steps: From the Source Files tab of the Build Application or Shared Library (DLL) dialog box, click the Add Dynamic VI button to add the following two VIs to the application: _Excel Dynamic VIs.vi in vi.lib\addons\ _office\_exclsub.llb _Word Dynamic VIs.vi in vi.lib\addons\ _office\_wordsub.llb If the application you are building contains the MS Office Report Express VI, you must add any Word or Excel templates that you use to the built application. From the Source Files tab, click the Add Support File button to add the template files to the application. By default, the custom destination for the templates is the same as the path that appears in the Destination directory field on the Target tab with a data subdirectory appended. Do not change the custom destination for the files you add. For example, if you are using the basic Excel template with the MS Office Report Express VI, add MSOffice_RGT_Template.xlt to the application. The basic template files are located in the templates\report directory. Refer to the LabVIEW Help for more information about building stand-alone applications. National Instruments Corporation 9 LabVIEW Report Generation Toolkit

Related Documentation The following documents contain information that you might find helpful: The LabVIEW Help includes information about Report Generation Toolkit VIs. Access the LabVIEW Help by selecting Help»VI, Function, & How-To Help. Navigate to the VI and Function Reference»Report Generation VIs book in the Contents tab for information specific to Report Generation Toolkit VIs. LabVIEW Application Builder User Guide Microsoft Word Help and Microsoft Excel Help are available with any version of Microsoft Office. LabVIEW Report Generation Toolkit 10 ni.com