XML problem

Stimulsoft Ultimate discussion
Post Reply
Guilherme.Camilo
Posts: 2
Joined: Wed Jul 27, 2016 8:21 pm

XML problem

Post by Guilherme.Camilo »

I was trying to export a report to xml but the DATATABLE class was converted with the name “table1” instead of their true name.
XML result
XML result
sample.png (24.59 KiB) Viewed 3880 times
Error location
Error location
code.png (163.25 KiB) Viewed 3880 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: XML problem

Post by HighAley »

Hello.

Sorry, maybe we don't understand you right.
Could you describe your scenario more detailed?

Thank you.
RodrigoGT
Posts: 5
Joined: Wed Jan 28, 2015 6:59 pm

Re: XML problem

Post by RodrigoGT »

Hello,

I have the same problem.

if I try to export a report as xml, the name of the node elements is not being assigned correctly.
I created a example on GitHub to illustrate the problem.
https://github.com/RodrigoGT/StimulsoftSample

the sample shows two xml, the first xml is what I expected to be generated by the report
and second xml was generated by the report.

if you look into the xml generated by the report, you'll notice that the element name appears as "Table1" but it supposed to look like "Category".

how do I set the element name correctly?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: XML problem

Post by HighAley »

Hello, Fabiano.

We have added a new export setting:
StiXmlExportSettings.TableName

It will be available in the 2018.1.4 build.
You could set this option and get necessary result.

Thank you.
RodrigoGT
Posts: 5
Joined: Wed Jan 28, 2015 6:59 pm

Re: XML problem

Post by RodrigoGT »

Hello,

the problem was not fixed.

the export settings are not being passed on "StiReport.Export.cs" to "StiXmlExportService", on method "public void ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)"
Original Code
Original Code
original code.png (39.38 KiB) Viewed 3832 times
a possible solution is
Proposed Fix
Proposed Fix
proposal.png (40.62 KiB) Viewed 3832 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: XML problem

Post by HighAley »

Hello.

Yes, there was an issue with ExportDocument() method.
We are fixing this issue right now.
You should set the TableName of the StiXmlExportSettigns and use the ExportXML() method.

Thank you.
RodrigoGT
Posts: 5
Joined: Wed Jan 28, 2015 6:59 pm

Re: XML problem

Post by RodrigoGT »

Hello,

An error was introduced in update 2018.1.5, an argument exception "An DataType property of the StiXmlExportSettings class can't be changed!" was thrown when I created a new instace of StiXmlExportSettings.
Error
Error
StimulsoftSample (Debugging) - Microsoft Visual Studio 2018-01-17 10.48.28.png (60.95 KiB) Viewed 3761 times
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: XML problem

Post by Edward »

Hi Rodrigo,

Thank you for the sample project that reproduces the issue. The problem has been confirmed, we will let you know in this topic once it is fixed.

Thank you,
Edward
5629
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: XML problem

Post by Edward »

Hi Rodrigo,

The issue has been fixed and the next build will have the fix included.
In the meantime, could you please use the following code, that will create a similar object of settings:

Code: Select all

var settings = new StiDataExportSettings(StiDataType.Xml);
Thank you,
Edward
Post Reply