Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Using ADO.Net Datasource in Java Post Reply Post New Topic
Author Message
Roland
Newbie
Newbie


Joined: 10 Jun 2012
Online Status: Offline
Posts: 2
Quote Roland Replybullet Topic: Using ADO.Net Datasource in Java
    Posted: 10 Jun 2012 at 8:32pm
Hello,
we want to migrate in our company our printing from .Net to java-based server. There I have the problem, that I couldn't set data in the report in java at runtime.
I tried it with
    document.getDatabaseController().setDataSource(dataset,"", "");
and as datasource I used a XMLDataSet

I use the same xml-data and schema as in the .Net environmet.

The reports are designed in Crystal Report Designer and as datasource is an ADO.Net (XML) connection used.

In the old version I use in the .Net-Code a ADO.Net dataset as datasource.
For example
Schemafile:
<?xml version="1.0" standalone="yes"?>
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Parameters">
<xs:complexType>
<xs:sequence>
<xs:element name="DPPROG" type="xs:string" minOccurs="0" />
<xs:element name="DPPANR" type="xs:string" minOccurs="0" />
<xs:element name="DPPAUS" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="DSFIRM" type="xs:string" minOccurs="0" />
<xs:element name="DSWKNR" type="xs:string" minOccurs="0" />
<xs:element name="DSFIBZ" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

Data-File
<?xml version="1.0" standalone="yes"?>
<C1PS98>
<Parameters>
<DPPROG>C1PS98</DPPROG>
<DPPANR>*DFT</DPPANR>
<DPPAUS />
</Parameters>
<Header>
<DSFIRM>9</DSFIRM>
<DSWKNR>000</DSWKNR>
<DSFIBZ>DEV-Firma-X (9.000)</DSFIBZ>
</Header>
</C1PS98>

Is there an option to fill the data to the report at runtime in java?

If I would change the datasource in the designer from ADO.NET (XML) to "XML and Webservices". I have the problem, that the used datatables have a different nameing convention. In the report designer I see the following tablenames with the same schema-file.

ADO.NET - Datasource:
  • Header
    ....
  • Parameters
    ....
XML und Webservices - Datasource:
  • C1PS98/Header
    ...
  • C1PS98/Parameters
    ...

It is important to reuse or old reports and don't have to redesign each of them, because we have a lot of reports.
Is there a possibility to migrate the report in code? Maybe I can write a .Net or java application to reset the datasources per field. So that I can fill the report in java with datas.
Meanwhile I haven't found a solution yet.
Have anyone a solution or idea for solving my problem?

Thank you for helping.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.