Page 1 of 1

Custom "save a copy" function

Posted: Sat Dec 22, 2012 7:44 am
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

Re: Custom "save a copy" function

Posted: Sat Dec 22, 2012 12:20 pm
by HighAley
Hello.

Please, try to set next property:

Code: Select all

stiReportDesigner.report.reportAlias = NEW_REPORT_NAME;
Thank you.

Re: Custom "save a copy" function

Posted: Sat Dec 22, 2012 8:49 pm
by Chipo
Sorry, does not work for me. I still receive old report name as a parameter for save report action.

Re: Custom "save a copy" function

Posted: Wed Dec 26, 2012 6:39 am
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.

Re: Custom "save a copy" function

Posted: Wed Dec 26, 2012 9:51 pm
by Chipo
Awesome job guys. Works perfectly.
"Like" form me on Stimulsoft facebook for that.

Best regards.

Re: Custom "save a copy" function

Posted: Thu Dec 27, 2012 6:29 am
by HighAley
Hello.

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

Thank you.