Sie sind auf Seite 1von 11

Test Universe Data Export

Sample: Reporting with Crystal Report in Visual Studio 2005

OMICRON Test Universe

Manual Version: TU_Data_Export_Crystal.AE.1 OMICRON electronics 2006 This Reference Documentation is a publication of OMICRON electronics GmbH. All rights including translation reserved. Reproduction of any kind, e.g., photocopying, microfilming or storage in electronic data processing systems, requires the explicit consent of OMICRON electronics. Reprinting, wholly or in part, is not permitted. This Reference Documentatiomn represents the technical status at the time of printing. The product information, specifications, and all technical data contained within this user manual are not contractually binding. OMICRON electronics reserves the right to make changes at any time to the technology and/or configuration without announcement. OMICRON electronics is not to be held liable for statements and declarations given in this Reference Documentation. The user is responsible for every application described in this Reference Documentation and its results. OMICRON electronics explicitly exonerates itself from all liability for mistakes in this manual.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

Reporting with Crystal Report in Visual Studio 2005


Requirements for running the sample:
Microsoft .NET Framework version 2.0 Microsoft Visual Studio 2005: o o Microsoft Visual C# 2005 Crystal Reports for Visual Studio 2005

Sample description
This sample shows how: TU Data can be read easily within the .NET Framework (C#) and Custom reports can be created (and designed) within a third party reporting component.

The exported document will contain a State Sequencer with multiple shots used to test an under voltage relay (between two voltages U1 and U2 that are read from XRIO). The external application reads the exported result data and shows a report with a graphical representation of the trip time depending on the voltage. Sample for exporting Test Data to C# / .NET-coded application software Note: 1. The naming of the parameters may differ, according to the registry settings (e.g. VL1-E). 2. The sample documents can be found in the Test Library. We assume an Undervoltage relay with inverse-time tripping characteristic t,trip = f(V) with V < Vnom (e.g. AREVA P435 function group V<> set for inverse-time undervoltage tripping) Set the max. test voltage Vmax and the min. test voltage Vmin as well as the max. expected trip time tmax in User Parameters section of Test Object Run test: 10 voltage shots evenly spaced between Vmax and Vmin will be generated in State Sequencer Export the Data to XML Import in Excel or .NET application Get graphical representation tact = f(Vtest) of the tripping curve in the external application

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

Creating the sample


1. Export the data

Export the data using the file name XMLSample_NET.XML for document XMLSample_Excel_NET.occ.

2.

Creating the project


1. Open the Visual Studio 2005 and select the File menu and then New and Project.
2. In the New project dialog select the Visual C# Windows from the Project types and Crystal Reports Application from the Templates. Set the name for the project to XMLSample_NET and click OK. 3. Then the Crystal Reports Gallery is prompt. Choose to create a new Crystal Report document Using the Report Wizard. Choose the Standard Expert and click OK. 4. In Standard ReportCreation Wizard dialog from the Avaiable Data Sources click the Create New Connection and then the ADO.NET item. 5. In ADO.NET dialog use the browse button to select your XML file in the File Path and click Finish.

Steps to create the VS2005 Crystal Report project:

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

6. In Standard ReportCreation Wizard dialog under the ADO.NET item you have a data source named TestUniverseExport. Select the TestUniverseExport data source and click the ">>" button to have it in the Selected Tables. Under the TestUniverseExport you can see the tables contained in the XML document.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

7. Click Next to see how the tables are link together.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

8. Click Next to select the fields you want to display in you report. After selecting the fields click Finish.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

3.

Creating the report

A new report document is created CrystalReport1.rpt and opened in the report designer.

Run the sample to see the result: Go to the Debug menu and click Start Without Debugging.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

We need to obtain the amplitude of the voltage only for the Undervoltage state and also to remove the duplicates generated by the adding of the Tact and MeasNumber column (for each value of the voltage the whole range of Tact values were added) All odd states are prefault and all even states are fault states so the values corresponding to the Undervolatge are the ones having the ProgOrderNumber 2,4,6,

Filter the data for the report


1. Filter the Name column after VL1-E - go to the Crystal Reports menu and open the Report and then click on the Select Expert and add a new select after the Name and click OK.

To filter the values we need to return to the design mode (by closing the current execution of the program)

2. Filter the amplitude of the voltage to display only the fault states. Go to the Crystal Reports menu and open the Report and then click on the Section Expert. 3. Select the Details from Sections and click the formula button besides Suppress(No Drill-Down). 4. In the Formula Workshop dialog write the following formula:

IIF({AnalOutSignal.ProgOrderNumber} = (2*{Seq_Measurement.MeasNumber}), False, True) and then click the Save and close button.

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

5. Click OK for the Section Expert dialog. 6. Run the sample to see the result: Go to the Debug menu and click Start Without Debugging.

10

OMICRON Test Universe

Reporting with Crystal Report in Visual Studio 2005

Modifying the XML Data Source.

Execute the test again e.g. with different relay settings and do the XML data export. Refresh the application from the Refresh button to see the results in the data bound Crystal report.

11

Das könnte Ihnen auch gefallen