Page 1 of 2

Create a Custom XML export

Posted: Wed Oct 08, 2014 7:49 pm
by dmastropietr
Hi folks - I wanted to be able to create a custom XML export format using the dataset of my report. Ideally I'd like for the user to choose Export -> Data File, set the type to XML and set the file save location, and then I catch all of that info, and in the case of XML do my thing.

This was currently working perfect in v13.3, then I updated and it stopped. I had subscribed to the process_export event

private void stiViewerControl1_ProcessExport(object sender, EventArgs e)
{
StiExportService service = sender as StiExportService;

if (service is StiXmlExportService)
{
// Do my custom export
}
else
{
service.Export(_report.CurReport, null, false);
}
}

but now the even that I catch is a StiDataExportService. Is there some way to keep my functionality, and without affecting anything else just change the way that the XML export works?

Just a Note, I'm working in Stimulsoft .Net v14.1.

Thanks,
~Daniel

Re: Create a Custom XML export

Posted: Fri Oct 10, 2014 5:14 am
by HighAley
Hello, Daniel.

Sorry, for the delay with answer. We have found the problem.
We need some additional time to solve it.

Thank you.

Re: Create a Custom XML export

Posted: Wed Oct 15, 2014 8:20 pm
by dmastropietr
Hi - what timeline do you see having this fixed in? I'm using v2014.1, so I'm gathering a hotfix would be available for this release.

Re: Create a Custom XML export

Posted: Thu Oct 16, 2014 12:31 pm
by HighAley
Hello.

The fix will be available later this month.

Thank you.

Re: Create a Custom XML export

Posted: Thu Oct 23, 2014 9:43 pm
by dmastropietr
Would I be able to get an update on this - you expect to be able to deliver a fix next week?

Thanks

Re: Create a Custom XML export

Posted: Fri Oct 24, 2014 8:05 am
by HighAley
Hello.

We are still working on this issue.
There was code refactoring and we need some time to make StiDataExportService available again.
We will give you more detailed answer on Monday.

Thank you.

Re: Create a Custom XML export

Posted: Thu Oct 30, 2014 1:17 pm
by dmastropietr
Hi Aleksey - would you have an update on this? You mentioned that you'd have more information Monday past...

Thanks,

Re: Create a Custom XML export

Posted: Thu Oct 30, 2014 1:35 pm
by HighAley
Hello.

Sorry for the delay we had more important tasks.
We will learn your problem tomorrow.

Thank you.

Re: Create a Custom XML export

Posted: Fri Oct 31, 2014 11:22 am
by HighAley
Hello.

We have made an improvement.
The patch will be available in our next prerelease build.
You could use next event:

Code: Select all

            StiOptions.Engine.GlobalEvents.ProcessExport += new Stimulsoft.Report.Events.StiProcessExportEventHandler(GlobalEvents_ProcessExport);


        void GlobalEvents_ProcessExport(object sender, Stimulsoft.Report.Events.StiProcessExportEventArgs e)
        {
            if (e.ExportFormat == StiExportFormat.Xml)
            {
                e.Processed = true;

                //your export code
                //.........
            }
        }
Thank you.

Re: Create a Custom XML export

Posted: Mon Nov 03, 2014 2:49 pm
by dmastropietr
Thanks Aleksey,

The only thing is that the ProcessExport event is called when you select the Menu item (which is Export Data in this case). So when you go into this event your sender is an StiDataExportService, and the e.ExportFortmat is at the default, which is csv. It's the next window that lets you select the data format as xml, and then this window does not seem to have an event that I can hook into.

Do you have any way that I can actually get an event telling me that I am exporting to xml? And you mention that the code will be in the next prerelease build, when would your next maintenance that would release this code be, and is there anyway that I could get this in a hotfix?

thanks,
~Daniel