Sie sind auf Seite 1von 2

SAP Business One Notes

1704366 - Exporting SAP Business One Forms into XML Compatible for Crystal Reports
Version 3 Validity: 22.05.2012 - active

Language English

Symptom
To create a CR (Crystal Reports) layout based on data from SAP Business One, you need to create the same business logic in Crystal Reports,
and sometimes the resulting data are not consistent with those on the relevant SAP Business One form.

Solution
As of SAP Business One 8.82 PL06, the system allows you to export data from SAP Business One forms to XML data files with an internal
structure suitable for import to Crystal Reports. Partners and customers can now create CR layouts more easily by using data already available on
SAP Business One forms.
If a CR layout contains an XML data source with a specific name (an XML data source used for internal purposes), then during print or preview
operations for this layout, the system exports the corresponding SAP Business One form into an XML file. The structure of this XML file
corresponds to the structure of the SAP Business One form. Crystal Reports runtime then uses the newly generated XML file for the XML data
sources referenced in the layout. If there is an inconsistency between a CR layout and a SAP Business One form, an error message or incorrect
data may be displayed (for example, if an XML data source or a data field is referenced in the layout but not in the form, or used in a different
context).
Using XML Data Support
Prerequisite
You have saved the initial XML file (attached to this note) to your computer. The file is named B1_CR_GenericForm-Initial.xml,andcontainstwo
data sources that are used in the procedure.
Procedure
1. Select a CR layout you want to work with (a blank layout can also be used) and open it in CR Developer.
2. Choose MenuDatabaseDatabase Expert.
ToaddtwonewdatasourcesfromtheXMLfile,chooseCreate New ConnectionADO.NET (XML). The ADO.NET window appears.
IntheFile Path field, click the Browse icon and select the initial XML file (B1_CR_GenericForm-Initial.xml).
Thetwoaddeddatasourcesare:
l
l

B1_CR_GenericForm - this data source is used for internal purposes and should not be removed.
B1_CR_GenericForm_FormInformation - this data source contains the formTitle data field corresponding to the title of the SAP Business
One form.

3. To add the formTitle field to the layout, choose MenuViewField Explorer. From the Field Explorer window, drag the formTitle field to the
layoutheader.
4. Save the layout in the CR developer application.
5. Start SAP Business One and open the relevant form. The form should contain data so that it can be previewed. For example, you can open the
A/P invoice that was added last to the system.
6. To import the layout (from step 4) choose Menu -> Layout Designer (the Pencil icon).
TheLayout and Sequence window appears. Choose the Manage Layout button. The Report and Layout Manager appears. Choose the Import
button.
TheReport and Layout Import Wizard window appears. Choose Next.
ClicktheBrowseiconandselectthe*.rptfile(createdinstep4).IntheContent Type section, select the Layout radio button. Click the
Browsebutton.FromtheList of Document Types window, select the corresponding document type.
OntheLayout Import Wizard, choose Finish.
ClosetheReport and Layout Manager and the Layout and Sequence windows.
OpentheLayout and Sequence window again (the Pencil icon) and set the newly added CR layout as the default.
7. Run print preview (MenuFilePreview). The CR layout is displayed and the formTitle field is filled with the form title, for example ''A/P
Invoice''.
8. From your file manager, go to the %TEMP% directory in the file system. For example, go to StartRun... and in the Open field type 'cmd'.
Click OK. In the command window enter 'cd %TEMP%'. The directory path is displayed. There is a newly generated file named
B1_CR_GenericForm.xml . Copy this file to a directory of choice, for example to the directory where the created CR layout file (*.rpt) is stored.
9. In CR Developer, using Database Expert, create a new connection using the XML file from step 8. The data sources B1_CR_GenericForm and

B1_CR_GenericForm_FormInformation should be replaced by using this new connection. There are additional data sources containing data from
the B1 form:
l
l
l

B1_CR_GenericForm_FormItems -standardformitems,nottables(grids)
B1_CR_GenericForm_FormGrid_uId<No>_header - grid no. <No> - header data
B1_CR_GenericForm_FormGrid_uId<No>_line - grid no. <No> - line data

DesiredsourcescanbeaddedtotheCRlayout.FieldsfromthesedatasourcescanbeusedintheCRlayout.

Other terms
Crystal Reports, layout, XML, XML data source, CR layout

Header Data
Released On 05.06.2012 14:42:57
Release Status Released for Customer
Component
SBO-REP-CR SAP Crystal Reports for SAP Business One
Priority
Correction with medium priority
Category
Program error

Validity
Software Component Version
SAP BUSINESS ONE 8.82
9.0
9.1

References
This document refers to:
SAP Business One Notes
1695118 XML Data Source for Crystal Reports in SAP Business One
CSS SAP Notes
1705407 Overview Note for SAP Business One 8.82 PL06

This document is referenced by:


SAP Business One Notes (5)
1722773 Special characters in generated XML data file B1_CR_GenericForm.xml
1808005 CR_Grid Columns with Integer Values Exported as Strings to CR XML
1736965 Crash when preview periodic Profit and Loss report created by XML
1951776 Overview Note for SAP Business One 9.0, version for SAP HANA PL09
1952869 Overview Note for SAP Business One 9.0 PL09

Attachments
File Name
File Size (KB) Mime Type
B1_CR_GenericForm-Initial.xml
1060 text/xml

Das könnte Ihnen auch gefallen