Connecting to XML Data Sources


Crystal Reports can connect to XML data in three ways. XML can be presented as source data as

  • Local data source This is a physical XML file that resides locally or on the network and is identified by passing in the fully qualified path and filename. If a schema (.xsd) file exists, it can also be specified.

  • HTTP(S) data source An HTTP(S) data source is XML-formatted data accessed from a servlet, an ASP page, or a JSP page. The URL to the source may be HTTP or HTTPS. When using HTTPS, the ID and password information passed into Crystal Reports is used for authentication.

  • Web Service data source A web service data source can be a service on a local machine or network drive that is referenced either via a path and filename or via a servlet/dynamic web page (ASP/JSP). No schema is specified as it is derived through the web services framework. Web Service data sources are accessed using Web Services Description Language (WSDL). After the WSDL is specified, the driver prompts for service, port, and method.

Regardless of the data source, from the File menu choose New, Blank Report. From the Data window, expand Create New Data Connection and double-click XML. From that point, follow one of the following paths.

Connect to a Local XML Data Source

1.

Specify the fully qualified path and filename to the .xml file. If the .xml file does not have embedded schema information, a schema (.xsd) file must be identified. To identify the schema file, ensure that there is a check mark beside Specify Schema File.

2.

Click Next.

3.

If the schema does not need to be specified, click Finish; otherwise, you will be prompted for the location of the schema. The schema may be referenced using a fully qualified path or URL.

4.

Click Next and then Finish.

Connect to an HTTP(S) Data Source

1.

Enter the URL to the .xml file. If the .xml file does not have embedded schema information, a schema (.xsd) file must be identified. To identify the schema file, ensure that there is a check mark beside Specify Schema File.

2.

Click Next.

3.

If authentication information is required, enter it here. Click Next.

4.

If the schema does not need to be specified, click Next; otherwise, you will be prompted for the location of the schema. The schema may be referenced using a fully qualified path or URL. Click Next.

5.

As a final step, HTTP parameters may be added/modified/removed in order to modify the set of data returned. Then click Finish.

Connect to a Web Service Data Source

1.

Select the Use Web Service Data Source radio button. No schema file is needed, so the option will be dimmed immediately on a selection of this data source type. Click Next.

2.

Specify the location of the web service. Either a local file or HTTP(S) location may be specified. Click Next.

3.

If prompted for it, enter authentication information and click Next.

4.

Select the service, port, and method from the lists. Click Finish.

After the connection to the data source is complete, the report may be designed as any other. The XML data is presented as a table just like any other Crystal Reports data source.




Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net