12/11/2011

Customising PowerINSPECT Excel Report Part A

Introduction

PowerINSPECT Excel reports are based on template files. Template files are, in fact, Excel Workbooks that describe how the information from PowerINSPECT will be arranged on the final report.

A Template File is divided into different Excel sheets. When customising a PowerINSPECT Excel Report, you will have to modify only two of them: The Template sheet and the Header sheet.

The Template sheet describes the look of the final report and is divided by section, each of one describing a specific report part.

The Header sheet is used to transfer variables between PowerINSPECT and the Report Generator, this sheet will reflect the variables that are defined in the PowerINSPECT Variable Property Sheet as shown in figure 1.

Figure 1 the PowerINSPECT Variable Property page

The Database sheet is used internally to record data for the Graphics and should not be modified.

The other sheet (3D Measure, Guided Point, Edge Point, Surface Point) are used to transfer items information between PowerINSPECT and the Report Generator and should not be modified.

The Test Gauss sheet is used internally to record data for the Gauss Graph and should not be modified.

Before you start.

Creating a new template file.

To create a new template file, please have a look to the existing template files. It's easier to modify a template that is almost what you need than to create one from scratch.

Make a copy of this file and copy it to the template directory with a different name.

Note : the template directory should be C:\dcam\product\PowerInspect1350\template.

Figure 2 the PowerINSPECT Zone Edition Dialog box

Avoiding problem with hidden documents:

When PowerINSPECT is creating a report, the PowerINSPECT Report generator load the requested template file and hide it. This template file is loaded as read only.

Before trying to modify a template, please check that the file is not hidden.

Go to the menu Window/unhide and select the document you what to unhide.

Some EXCEL prerequisites :

The PowerINSPECT Excel report mechanism use intensively named cells. Please read the Excel ? documentation to understand how to define named cells before starting. For example, to know which cells will be copied to the report, the PowerINSPECT Report Generator will look after a name 'Header'. Then, the PowerINSPECT Report Generator will copy this area to the clipboard and paste it to the final report.

Figure 3 the Excel Name dialog box

Using the Excel Tools to define Named Cells

To get a list of all used names in the Template Workbook select the command INSERT/NAME/DEFINE into EXCEL. The following dialog box will appear and will show you all the name used by the PowerINSPECT Report Generator.

span style='mso-ignore:vglayout;;z-index:1;left:0px;margin-left: -31px;margin-top:1px;width:215px;height:98px'

span style=';mso-ignore:vglayout; left:0pt;z-index:1'

Figure 4 PowerINSPECT Excel ToolBar

Using the PowerINSPECT Tools to manage Named Cells

The PowerINSPECT Report Generator provide a tool that will help you to define Named Cells in the Template Sheet.

Click on the EditZone Button in the PowerINSPECT Excel Toolbar to open the PowerINSPECT Zone Edition Dialog Box to define or locate named cells.

When you click select a section and a zone the matching cells in the Excel template will be hilighted.

You can redefine the zone by clicking the button , and then select the new cells. Then, press the Define button to save the new value.

Process

Template File
a Excel file that contains formatting ruled used by the PowerINSPECT Report Generator to create the final PowerINSPECT Report. The templates files are located in the c:/dcam/product/PowerInspect1350/template directory.

PowerINSPECT Document
a document created in the PowerINSPECT Main Application that contains the measure sequence and the associated results , the extension of this file is .PWI

PowerINSPECT Report Generator (PRG)
a Excel Add-in Macro that will create a final report file with the unformatted data sent by PowerINSPECT and the Template File.

Report
the report is the final PowerINSPECT report created as an Excel File by the PowerINSPECT Generator. This file is located in the same directory as the matching PowerINSPECT Document.
I.e. if the PowerINSPECT document is c:/dcam/product/powerInspect1350/myfiles/foo1.pwi the report file will be c:/dcam/product/powerInspect1350/myfiles/foo1.xls

How it's working

When you click on the Excel Icon in the PowerINSPECT Application, PowerINSPECT will send unformatted data from the current active measure to Excel. The PowerINSPECT Report Generator (PRG) will then open the final report (foo.xls) and create a sheet that will contains the final formatted report for that measure. The name of this sheet will be the measure name (i.e MasterPart or Measure 1). The report will contains one sheet for each measure you have in the PowerINSPECT Document (foo.pwi), and will be located in the same directory as your PowerINSPECT Document.

Then the PRG will open the Template file requested by PowerINSPECT. The PRG will analyse the unformatted data and, for each measure item, the PRG will transfer the unformatted item data to a transient area. The template file will now reflect new formatted information and PRG will transfer the Formatted Data to the final report.

http://www.cadfamily.com/html/Article/Customising%20PowerINSPECT%20Excel%20Report%20Part%20A_1036_1.htm

No comments: