on 06-02-2011 4:25 PM
I need set a XML string as datasource from report document. In many examples I see the use of Datasets for upset the XML data in Report. Is possible launch the report with only the XML? I need it that for performance purposes: the DataSet object is very slow.
I did try build a XMLDocument object from the XML string, but when i pass it to Report Document the data not appears. Seems don´t accept that source type.
Regards and many thanks for the help.
Reporting off of an XML string isn't going to be much faster. Crystal Reports is slow with datasets because we have to do all the sorting client side. The same will apply with your XML file data because there is no database to do some of the sorting work for us.
You should be able to use the ReportDocument.SetDatasource("C:\Path\To\Xml\File\myXML.xml") to point directly to the XML file.
Performance warning: This database driver should be used for small sets of data. It does not perform well with lots of data. Once you go above 10k to 20k rows of data you'll see significant performance issues - especially if you have multiple linked tables. Use a flat XML structure for best results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I try
ReportDocument.SetDatasource("C:PathToXmlFilemyXML.xml")
the report don´t show data. The same xml file with the Dataset mechanism works good. Is needed something more for works?
The XML used is that:
¿report?
¿header nombre.informe="Informe Resumen de Documento" Fecha="Tue May 31 12:32:56 CEST 2011"/?
¿documentos?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Testamento" nota.codigoUltimasVoluntades="COD." nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0001" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0601/0000" operacion.descripcionActoJuridico="Compraventa" nota.codigoUltimasVoluntades="COD: UV" nota.apellido2="Apellido2" documento.identificacionDocumento.numeroDocumento="11-0001" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0001" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0001" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0004" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0004" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0004" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0006" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0006" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0006" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0006" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0006" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0007" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿documento operacion.cuantiaTotal="35500.34" operacion.codigoActoJuridico="0501/0000" operacion.descripcionActoJuridico="Descripcion acto jurídico" nota.codigoUltimasVoluntades="CODI 342875" nota.apellido2="Apellido1" documento.identificacionDocumento.numeroDocumento="11-0009" nota.nombre="Nombre" nota.apellido1="Apellido1"/?
¿/documentos?
¿/report?
The text don´t allow write xml code correctly; please, change the {} for ¿?
Many thanks for the help.
Edited by: nullPointer on Jun 3, 2011 10:38 AM
Edited by: nullPointer on Jun 3, 2011 10:38 AM
Edited by: nullPointer on Jun 3, 2011 10:39 AM
Edited by: nullPointer on Jun 3, 2011 10:43 AM
Create a new report, In the Database Wizard select ADO.NET ( XML ), browse to your XML file and then drop the fields into the report. If you don't see fields or data then your XML is not in the correct format.
Create another new report and this time connect to your database directly using ODBC or OLE DB. Drop the fields you want in your XML file into the report and then Preview. If the data is there then export the report to XML. Now go back and create a new report off of that new XML file and you should see data.
Now compare your original XMl to the new XML and you'll see what CR Requires in the XML file.
Don
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.