Page 1 of 1

List of variables from report

Posted: Tue Sep 18, 2012 6:15 am
by Chipo
Hi,

I created some variables for the report (Designer->Dictionary->Variables ...)
Is there any way to get list of variables defined in the report on the runtime when I display the report?

Best regards

Re: List of variables from report

Posted: Wed Sep 19, 2012 12:09 pm
by Vladimir
Hello,

Please see the attached sample project:
Sample.zip
(23.45 KiB) Downloaded 462 times
Thank you.

Re: List of variables from report

Posted: Thu Sep 20, 2012 6:00 am
by Chipo
Hi,

thank you for response. I can change the variable now.
Small question: How I can rerun report in the same viewer after changing the variables?

Best regards.

Re: List of variables from report

Posted: Mon Sep 24, 2012 11:02 am
by HighAley
Hello.

You could use next code:

Code: Select all

viewer = report.showDialog();

.....

report.isRendered = false;
viewer.report = report;
Thank you.

Re: List of variables from report

Posted: Wed Oct 10, 2012 12:19 am
by Chipo
Hi,

thank you for response. In fact I did the following and it worked

Code: Select all

reportViewer.report.isRendered = false;
reportViewer.report.render(false);
reportViewer.report.show(reportViewer);

Re: List of variables from report

Posted: Wed Oct 10, 2012 3:17 am
by Chipo
Hi,

I have report SQL query like that

Code: Select all

... and (primarycity in ({Suburb})) ...
when I updated variable

Code: Select all

reportViewer.report.variables["Suburb"] = "Bondi Junction";
it arrives to the server side as following
... and (primarycity in (Bondi Junction)) ...


when I updated variable

Code: Select all

var values: Array = [];
values.push("Bondi Junction");
values.push("DRUMMOYNE");
reportViewer.report.variables["Suburb"] = values; 
it arrives to the server side as following
... and (primarycity in (Bondi Junction,DRUMMOYNE)) ...


when I updated variable

Code: Select all

reportViewer.report.variables["Suburb"] = "'Bondi Junction'";
it arrives to the server side as following
... and (primarycity in (\'Bondi Junction\')) ...


when I updated variable

Code: Select all

var values: Array = [];
values.push("'Bondi Junction'");
values.push("'DRUMMOYNE'");
reportViewer.report.variables["Suburb"] = values;
it arrives to the server side as following
... and (primarycity in (\'Bondi Junction\',\'DRUMMOYNE\')) ...

I checked the content before real query execution in ReturnXmlOrSqlData.processLoadData() method.

For some reason you escaped the single quotation sign in both array and single value and do nothing if quotation absent.

How I can avoid this quotation escape during the setup of the variable on the flex side?

Re: List of variables from report

Posted: Wed Oct 10, 2012 12:14 pm
by Vladimir
Hello,

You can use this option:

Code: Select all

StiOptions.engine.escapeQueryParameters = false;
Thank you.