Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Windchill Report Interface in Excel

Similar presentations


Presentation on theme: "Creating a Windchill Report Interface in Excel"— Presentation transcript:

1 Creating a Windchill Report Interface in Excel
Create your initial report in Windchill using Report Manger. Report manager is accessible from the Org* and Site tabs. * We create all of our reports on the Org tab.

2 Creating a Windchill Report Interface in Excel
Generate the report using the HTML (with sorting) output and copy the URL of the executed report.

3 Creating a Windchill Report Interface in Excel
Create an iqy file using notepad. This file will be used to create the web query in excel. Create a text document on your desktop in the following format. Paste the URL of the executed report under the text 1. If you have parameters, you will want to change your URL to prompt you for them in excel. Find the value(s) that you entered when you executed the report and replace them with the following: [“Your Prompt Name”, “Your Prompt Message”] Save the file with an iqy extension.

4 Creating a Windchill Report Interface in Excel
Create a new excel file and create a new connection. Create a new workbook and add a new data connection. Browse for More to find the iqy file you just created and open it.

5 Creating a Windchill Report Interface in Excel
Create a new excel file and create a new connection.

6 Creating a Windchill Report Interface in Excel
Enter a value in you parameter cell to avoid running a large query. Enter a Value in the cell you selected to contain your parameter.

7 Creating a Windchill Report Interface in Excel
Add the connection to your sheet. To embed the report, click on Existing Connections. Select the connection you just created and click Open.

8 Creating a Windchill Report Interface in Excel
Add the connection to your sheet. Select the cell where you would like the report begin then click OK.

9 Creating a Windchill Report Interface in Excel
Your report will run using your parameter value. You can leave this report as is or, you can add some VB script to make the report more user friendly. The next couple slides will give you an example of an embedded report with VB script.

10 Example of VB Code The following report allows the user to enter a document number with a wildcard. Using the buttons provided, the user can run the report, clear the results or download all the content. When executed, the report also allows the users to download individual documents. Parameter was set to cell B3 without auto-refresh. Three buttons were created and assigned to a macro.

11 Below is the code used for each button
Example of VB Code Below is the code used for each button Macro for the “Run Report” Button Sub RefreshReport() Sheet1.Range("B6:B8").ClearContents Sheet1.Range("A11:D65536").ClearContents Application.ScreenUpdating = False If Sheet1.Cells(3, 2) <> "" Then TrimNumber = RTrim(Sheet1.Cells(3, 2)) Sheet1.Cells(3, 2) = TrimNumber 'Run the Report Sheet1.Range("B3").QueryTable.Refresh BackgroundQuery:=False 'Remove the Header Links Sheet1.Range("A10:D10").Hyperlinks.Delete 'Set Links I = 11 Do While Sheet1.Cells(I, 1) <> "" ActiveSheet.Hyperlinks.Add Anchor:=Sheet1.Cells(I, 2), Address:= _ Sheet1.Cells(I, 2).Value, TextToDisplay:="Download Content" I = I + 1 Loop 'Fix the Column Widths, Alignment and Formatting Sheet1.Columns("A:D").EntireColumn.AutoFit Sheet1.Columns("A:D").Select Selection.Font.Bold = True With Selection .HorizontalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext End With Else 'Throw Error for Missing Document MsgBox ("A Document Number is required to run this report. Please enter a Document number and try again.") Sheet1.Cells(3, 2).Activate End If Application.ScreenUpdating = True End Sub Macro for the “Clear” Button Sub CleanReportContents() Sheet1.Range("B3").ClearContents Sheet1.Range("B6:B8").ClearContents Sheet1.Range("A11:D65536").ClearContents End Sub Macro for the “Download All Content” Button Sub DownloadAllContent() If Sheet1.Cells(11, 1) <> "" And Sheet1.Cells(8, 2).Value < 6 Then Application.ScreenUpdating = False I = 11 Do While Sheet1.Cells(I, 1) <> "" Sheet1.Cells(I, 2).Select Selection.Hyperlinks(1).Follow I = I + 1 Loop Application.ScreenUpdating = True Else 'Throw Error for Missing Document MsgBox ("No content to download or records retrieved is too large for mass download") End If End Sub


Download ppt "Creating a Windchill Report Interface in Excel"

Similar presentations


Ads by Google