Consultor Eletrônico



Kbase P167803: 4GL/ABL: How to create XML based Crystal Reports XI report object?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/22/2010
Status: Unverified

GOAL:

4GL/ABL: How to create XML based Crystal Reports XI report object?

GOAL:

How to use XML as the data source for a Crystal Reports XI report object?

GOAL:

How to report XML data using Crystal Reports XI and ABL Windows?

GOAL:

How to load an XML file into a Crystal Reports XI report object using ABL/4GL?

GOAL:

How to view Crystal Reports XI report object on an ABL window using the Crystal Reports XI Viewer?

FACT(s) (Environment):

Windows
OpenEdge 10.x

FIX:

A. Create the initial Crystal Reports report object:
1. Run the CreateXmlFiles.p procedure in the first note below against the sports2000 to generate the initial ttCustomer.XML and ttCustomer.XSD files used to create the Crystal Reports XI report object.
2. Run the Crystal Reports XI application.
3. Select: File > New > Standard Report.
4. On the ?Standard Report Creation Wizard?, double-click the ?Create New Connection? node.
5. On the ?Create New Connection? branch, double-click the ?XML? node.
6. On the ?XML (data source) type and location? page of the XML dialog, check the ?Use Local Data Source? radio-button > Browse to your local XML file > check ?Specify Schema File? check box > click: the ?Next? button.
7. On the ?Schema file type and location? page of the XML dialog, check the ?Use Local Schema? radio-button > Browse to your local XSD file and click the ?Finish? button.
8. Back on the ?Standard Report Creation Wizard?, double-click the ttCustomer node created to expand it and add both the ttCustomer and the ttCustomer/ttCustomerRow to the ?Selected Tables? column.
9. Walk through the rest of the ?Standard Report Creation Wizard? to add all the fields on the report skipping any grouping and or record selection questions.
10. Save the report as ttCustomer.rpt.
B. Create an ABL Window sample application to generate XML file and schema, load the XML data into the Crystal report object and display the data in Crystal Reports Viewer:
1. Run an AppBuilder session.
2. Create a new Window.
3. Drop the Crystal ActiveX Report Viewer 11.5 OCX onto the window and size it as desired.
4. Add the following TEMP-TABLE definition to the windows Definitions section:
DEFINE TEMP-TABLE ttCustomer LIKE Customer.
5. Drop two buttons CreateXMLFileAndSchemaFiles and LoadXMLDataAndViewReport on the Window
6. Create a CHOOSE event trigger for the CreateXMLFileAndSchemaFiles with the following code:
RUN CreateXMLFileAndSchemaFiles .
7. Create a CHOOSE event trigger for the LoadXMLDataAndViewReport with the following code:
RUN LoadXMLDataAndViewReport .
8. Create the CreateXMLFileAndSchemaFiles internal procedure using the code in the second note below.
9. Create the LoadXMLDataAndViewReport internal procedure using the code in the third note below.
10. Save and Run the Application.
11. Click the CreateXMLFileAndSchemaFiles button to create the XML and XSD files.
12. Click the LoadXMLDataAndViewReport to load the data created in step 11 above into the report and display it in the Crystal Report Viewer.