LabVIEW Report Generation Toolkit for Microsoft Office



Similar documents
LabVIEW Report Generation Toolkit for Microsoft Office User Guide

Getting Started with the LabVIEW Mobile Module Version 2009

Getting Started with the LabVIEW Mobile Module

Coupling Microsoft Visio with NI Requirements Gateway

LabVIEW Internet Toolkit User Guide

Coupling Microsoft Excel with NI Requirements Gateway

LABVIEW DSP TEST TOOLKIT FOR TI DSP

LabVIEW DSP Test Integration Toolkit for TI DSP

Chapter 11 Compound Documents in Windows 3.1

Word 2010: Mail Merge to with Attachments

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

Generating a Custom Bill of Materials

Report Generation Toolkit for Microsoft Office User Manual

Appendix A How to create a data-sharing lab

Getting Started Manual

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

EET 310 Programming Tools

Working together with Word, Excel and PowerPoint

Create a New Database in Access 2010

Virtual Communities Operations Manual

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

Excel Reports and Macros

Crystal Reports Designer Version 10

How To Create A Report In Excel

NI Real-Time Hypervisor for Windows

Microsoft Access 2007

Q&As: Microsoft Excel 2013: Chapter 2

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

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

SPSS: Getting Started. For Windows

System Overview and Terms

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

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Microsoft Office Access 2007 Basics

LabVIEWTM. Database Connectivity Toolkit User Manual. Database Connectivity Toolkit User Manual. June A-01

Microsoft Office PowerPoint 2013

Automate tasks with Visual Basic macros

Ansur Test Executive. Users Manual

Excel 2010: Create your first spreadsheet

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

MICROSOFT WORD: MAIL MERGE

MicroStrategy Desktop

Getting Started with Excel Table of Contents

Smart Web. User Guide. Amcom Software, Inc.

Mail Merge Creating Mailing Labels 3/23/2011

NI TestStand Version 2012

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

MICROSOFT EXCEL 2011 MANAGE WORKBOOKS

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

Building A Very Simple Web Site

TIBCO Spotfire Automation Services 6.5. User s Manual

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

Advanced Presentation Features and Animation

Excel Reports User Guide

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

WHAT S NEW IN MS EXCEL 2013

Search help. More on Office.com: images templates. Here are some basic tasks that you can do in Microsoft Excel 2010.

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

v4.8 Getting Started Guide: Using SpatialWare with MapInfo Professional for Microsoft SQL Server

Crystal Reports Installation Guide

ODBC Driver Version 4 Manual

Results CRM 2012 User Manual

Excel Intermediate Session 2: Charts and Tables

3 What s New in Excel 2007

Joomla Article Advanced Topics: Table Layouts

Using the Advanced Tier Data Collection Tool. A Troubleshooting Guide

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

Crystal Reports Designer

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

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

NETWORK SOFTWARE DOCUMENTATION N Rev Q

1. Linking among several worksheets in the same workbook 2. Linking data from one workbook to another

MICROSOFT EXCEL 2010 ANALYZE DATA

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

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

Basics. a. Click the arrow to the right of the Options button, and then click Bcc.

How to create pop-up menus

Distance-Learning Remote Laboratories using LabVIEW

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

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

Search help. More on Office.com: images templates

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

Access 2007 Creating Forms Table of Contents

Exercise 10: Basic LabVIEW Programming

Administrator s Guide

To create a histogram, you must organize the data in two columns on the worksheet. These columns must contain the following data:

Macros in Word & Excel

Microsoft Office Access 2007 which I refer to as Access throughout this book

Using Microsoft Office to Manage Projects

HTML Templates Guide April 2014

Creating a Web Site with Publisher 2010

HOW TO CREATE AN HTML5 JEOPARDY- STYLE GAME IN CAPTIVATE

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

SPSS for Windows importing and exporting data

MICROSOFT OFFICE ACCESS NEW FEATURES

LabVIEW Lesson 5 Clusters

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

Database Forms and Reports Tutorial

1.5 MONITOR FOR FMS 6 USER GUIDE

Software User's Guide

Transcription:

USER GUIDE LabVIEW Report Generation Toolkit for Microsoft Office Version 1.1.2 Contents The LabVIEW Report Generation Toolkit for Microsoft Office provides VIs and functions you can use to create and edit reports in Microsoft Word and Excel formats from LabVIEW. In the LabVIEW Full and Professional Development Systems and the (LabVIEW 8.0 and later) Base Package, the Report Generation Toolkit modifies the VIs on the Report Generation palette to support Word and Excel formats in addition to HTML and standard LabVIEW report formats. In the (LabVIEW 7.0 and 7.1) Base Package, the toolkit adds the Report Generation Toolkit VIs to the Report Generation palette. The toolkit also adds palettes of Word-specific and Excel-specific VIs to the Report Generation palette in all versions of LabVIEW. 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. Run Microsoft Visual Basic for Applications macros from Word documents and Excel workbooks. Upgrading to Report Generation Toolkit 1.1.2... 2 Selecting Report Types... 3 Using Report Generation Express VIs... 3 Using the Report Express VI... 4 Using the MS Office Report Express VI with Word and Excel Templates... 4

Creating Custom Templates...5 Creating and Using Bookmarks in Word...5 Creating and Using Named Ranges in Excel...6 Using Graphs in Reports...6 Running Visual Basic Macros in Word and Excel...7 Creating Stand-Alone Applications...8 LabVIEW 8.0 and Later...9 LabVIEW 7.0 and 7.1...9 Related Documentation...10 Upgrading to Report Generation Toolkit 1.1.2 The Report Generation Toolkit contains the following changes from the Report Generation Toolkit 1.1: The Report Generation Toolkit no longer supports Windows 98, Me, or NT. You can use the Report Generation Toolkit with Office 2000, XP, 2003, and 2007. The default value of the measurement system for column width input for the Append Table to Report VI now is Default. If you use the Append Table to Report VI to append a table to an HTML report, LabVIEW ignores the measurement system for column width input. Instead, this VI multiplies the column width input by 100 to determine the maximum column width in pixels. The Include Express VI Configuration Information input of the Append VI List of SubVIs to Report VI specifies whether the report includes configuration information for any Express VIs on the block diagram. (Word 2007) The Total pages option of the Report Express VI and include page x of n option of the Word Set Page Numbering VI formats the page numbering as x/n where x is the current page number and n is the total page number. If you are upgrading from the Report Generation Toolkit 1.0.x, refer to the National Instruments Web site at ni.com/info and enter the info code exuzzi to access the LabVIEW Report Generation Toolkit for Microsoft Office User Guide for version 1.1. The Upgrading from Report Generation Toolkit 1.0.x section contains additional changes between version 1.0.x and 1.1. 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. You can set the report type in the New Report VI and the Report and MS Office Report Express VIs. Using Report Generation Express VIs 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. National Instruments Corporation 3 LabVIEW Report Generation Toolkit

Using the Report Express VI 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. 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 Configure MS Office Report dialog box appears. 2. Select Basic Report for Word or Basic Report for Excel from the Template pull-down menu. 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 pull-down menu 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 pull-down menu 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 the data is an array, as a table. If the data is an array, you also can select the Table or Graph options. 6. Use the Report Destination pull-down menu 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 Options button. Among other options, you can select the filename and location to save the file. Click the OK button to close the Configure Save to File Options dialog box. 7. Click the OK button to close the Configure MS Office Report dialog box. The Express VI icon on the block diagram displays inputs for all bookmarks or named ranges you configured as inputs. LabVIEW Report Generation Toolkit 4 ni.com

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 pull-down menu. 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. 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 Report for Word or Custom Report for Excel in the configuration dialog box of the MS Office Report Express VI. Creating Custom Templates 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. Refer to the Microsoft Word Help or Microsoft Excel Help for specific procedures to create templates. Creating and Using Bookmarks in Word You can use bookmarks to insert text, numbers, tables, or pictures into a Word document template. Word template filenames include the.dot extension. To create and view bookmarks in a Word template, open the template you want to use and refer to the Microsoft Word Help for the specific procedures to create and view bookmarks. 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 the data is an array, as a table or graph. You also can use the Report Generation 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. National Instruments Corporation 5 LabVIEW Report Generation Toolkit

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. Creating and Using Named Ranges in Excel Using Graphs in Reports 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. To define a named range in an Excel template, open the report template you want to use and refer to the Microsoft Excel Help for the specific procedure to define a named range. 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 the data is an array, as a table or graph. You also can use the Report Generation 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. 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 LabVIEW Report Generation Toolkit 6 ni.com

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 MSGraph Examples.llb in the labview\ examples\office directory for examples of inserting and formatting graphs in Word and Excel reports. 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 build 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. 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 manually import the module containing the macro 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. (Microsoft Word or Excel 2007) On the Developer tab, select Visual Basic. National Instruments Corporation 7 LabVIEW Report Generation Toolkit

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. Creating a reference 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. 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. LabVIEW Report Generation Toolkit 8 ni.com

LabVIEW 8.0 and Later When building applications with Report Generation Toolkit VIs, you must complete the following additional steps. Verify all files and VIs you use to build an application are in the LabVIEW project. Add the following VIs to the LabVIEW project: vi.lib\addons\_office\_exclsub.llb\_excel Dynamic VIs.vi vi.lib\addons\_office\_wordsub.llb\_word Dynamic VIs.vi From the Source Files page of the Application Properties or Shared Library Properties dialog box, navigate to the _Excel Dynamic VIs.vi and _Word Dynamic VIs.vi and select both VIs. Click the right arrow button next to the Dynamic VIs and Support Files list to add the two VIs to the application. If the application you are building contains the MS Office Report Express VI, you must add to the LabVIEW project and the built application any Word or Excel templates that you use. From the Source Files page, select the template then click the right arrow button next to the Dynamic VIs and Support Files list to add the template files to the application. For example, if you are using the basic Excel template with the MS Office Report Express VI, add MSOffice_RGT_Template.xlt to the LabVIEW project and the application. The basic template files are located in the labview\templates\report directory. Note The default custom destination for templates is a data subdirectory in the destination directory. Do not change the custom destination for the templates you add. LabVIEW 7.0 and 7.1 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: vi.lib\addons\_office\_exclsub.llb\_excel Dynamic VIs.vi vi.lib\addons\_office\_wordsub.llb\_word Dynamic VIs.vi National Instruments Corporation 9 LabVIEW Report Generation Toolkit

If the application you are building contains the MS Office Report Express VI, you must add to the built application any Word or Excel templates that you use. From the Source Files tab, click the Add Support File Button to add the template files to the application. 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 labview\templates\report directory. Note The default custom destination for templates is a data subdirectory in the destination directory. Do not change the custom destination for the templates you add. Related Documentation Refer to the LabVIEW Help for more information about building stand-alone applications. 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. (LabVIEW 7.0 and 7.1) Help»VI, Function, & How-To Help Navigate to the VI and Function Reference»Report Generation VIs book on the Contents tab for information specific to Report Generation Toolkit VIs. (LabVIEW 8.0 and later) Help»Search the LabVIEW Help Navigate to the VI and Function Reference»Programming VIs and Functions»Report Generation VIs book on the Contents tab for information specific to Report Generation Toolkit VIs. (LabVIEW 7.0 and 7.1) LabVIEW Application Builder User Guide or (LabVIEW 8.0 and later) the Fundamentals»Organizing and Managing a Project book on the Contents tab of the LabVIEW Help. Microsoft Word Help and Microsoft Excel Help are available with any version of Microsoft Office. LabVIEW Report Generation Toolkit 10 ni.com

National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on ni.com/legal for more information about National Instruments trademarks. Other 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. 2004 2007 National Instruments Corporation. All rights reserved. 373805A-01 Jan07