Custom "save a copy" function

Stimulsoft Reports.Flex discussion
Locked
User avatar
Chipo
Posts: 44
Joined: Thu Sep 13, 2012 4:09 am
Location: Sydney, Australia

Custom "save a copy" function

Post by Chipo »

Hi,

I have to implement custom "save as a copy" function for designer.
I do the following (stiReportDesigner - StiDesignerFx):

Code: Select all

// rename report in designer
stiReportDesigner.report.reportFile = NEW_REPORT_NAME;
stiReportDesigner.report.reportName = NEW_REPORT_NAME;
stiReportDesigner.report.isNew = true;
// save the report content
StiSaveManager.saveReport(stiReportDesigner.report);
but when request arrived to StiSaveAction I have old reportFile name as a parameter.

I tried figure out where it was taken from. I guess it is from ApiProvider (I use java api provider) for communication between flex and java parts.

I debugged all steps I could and saw old report name there (as a "reportKey" property). As far as I understood it was captured during first dispatch of StiApiProviderEvent.LOAD_REPORT event.

How I can reassign reportKey property in the api provider?

Merry XMass
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom "save a copy" function

Post by HighAley »

Hello.

Please, try to set next property:

Code: Select all

stiReportDesigner.report.reportAlias = NEW_REPORT_NAME;
Thank you.
User avatar
Chipo
Posts: 44
Joined: Thu Sep 13, 2012 4:09 am
Location: Sydney, Australia

Re: Custom "save a copy" function

Post by Chipo »

Sorry, does not work for me. I still receive old report name as a parameter for save report action.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Custom "save a copy" function

Post by Vladimir »

Hello,

We understand the problem, the report key is cached in the ApiProvider library. We added a new function that will allow to clear this cache.
ApiProvider_Java.zip
(183.78 KiB) Downloaded 301 times

Code: Select all

StiApiProviderJava(StiApiProvider.provider).clearReportKey();
As a new key value is taken report.reportFile property.


Thank you.
User avatar
Chipo
Posts: 44
Joined: Thu Sep 13, 2012 4:09 am
Location: Sydney, Australia

Re: Custom "save a copy" function

Post by Chipo »

Awesome job guys. Works perfectly.
"Like" form me on Stimulsoft facebook for that.

Best regards.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom "save a copy" function

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you will need any additional help.

Thank you.
Locked