Page 1 of 1

Load Report by clicking button

Posted: Fri Dec 23, 2016 11:25 am
by marianux
Hi,
i'm using last version of ASP.NET MVC Viewer.
I got a jquery plugin for building a SQL where statement. (http://querybuilder.js.org/index.html)
Then when i click a button, i get sql from jquery plugin, then request to an stored procedure where apply this SQL-where-statement and retrieve all rows and display them to a grid.
Id like the same funcionality with reports, so when i click button it loads report.
So id like to know how to:
- Initial Load view -> doesnt load report.
- Click button, recover sql from pluging and then request report
- In Action GetReportSnapshot i must get sqlwhere statement and load report

Do you have any sample similar?

Thanks in advance.

Re: Load Report by clicking button

Posted: Mon Dec 26, 2016 1:01 pm
by Alex K.
Hello,

You can use the following code to change sql query after loading report in GetReportSnapshot event:

Code: Select all

((StiSqlSource)report.Dictionary.DataSources[ "DataSourceName"]).SqlCommand = newSqlCommand;
Thank you.

Re: Load Report by clicking button

Posted: Thu Mar 16, 2017 5:33 pm
by marianux
Aleksey wrote:Hello,

You can use the following code to change sql query after loading report in GetReportSnapshot event:

Code: Select all

((StiSqlSource)report.Dictionary.DataSources[ "DataSourceName"]).SqlCommand = newSqlCommand;
Thank you.
hi for your answer but i think you didnt understand what i need:
1) how can i show a report when i click a button that is outside from report, i dont want report is showed when view is loaded.
2) how can i pass some parameter to GetReportSnapshot controller action when i click the button from point 1.

Thanks in advance.

Re: Load Report by clicking button

Posted: Fri Mar 17, 2017 2:31 pm
by Alex K.
Hello,

Could you send us a simple project which shows your we will try to find a solution for you.

Thank you.

Re: Load Report by clicking button

Posted: Tue Mar 21, 2017 10:03 am
by marianux
Hi, thanks for your answer,
finally for
1) i have created a partial view with code for viewer. Partial is called from ajax function that is triggered when user make click to a button and its merged to a div into view. It works right
2) I have passed parametter creating a Session variable. For me it's not the best option nor solution, i think it could be a good enhanced for future versions.

Re: Load Report by clicking button

Posted: Tue Mar 21, 2017 6:18 pm
by Alex K.
Hello,

Thank you for your information.
Please let us know if you need any additional help.

Thank you.