• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

XML as a Data Source

With the emergence of XML as a data interchange format, many customers wanted to create reports on XML documents. So in Crystal Reports 8.5, a new driver was released that allowed just this scenario. This ODBC driver reads certain types of XML documents. A new feature of this driver in version 9 of Crystal Reports is the ability to read multiple XML files, most commonly a folder of XML files that have the same schema. When using this driver, you will specify either a folder name or a file path to an XML file. Once connected, XML elements at the first level will be represented as fields that you can place on a report.

If you require more flexibility around reading XML files, a good approach to take is to write a COM or Java Data Provider to read the XML. This Data Provider can use one of the many readily available XML parsers to read in the XML and choose exactly what fields to return to Crystal Reports. Listing 21.3 is a sample Visual Basic COM Data Provider that reads in a simple XML file.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint