Load Report by clicking button

Stimulsoft Reports.WEB discussion
Post Reply
marianux
Posts: 11
Joined: Thu Oct 24, 2013 5:15 pm

Load Report by clicking button

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Load Report by clicking button

Post 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.
marianux
Posts: 11
Joined: Thu Oct 24, 2013 5:15 pm

Re: Load Report by clicking button

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Load Report by clicking button

Post 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.
marianux
Posts: 11
Joined: Thu Oct 24, 2013 5:15 pm

Re: Load Report by clicking button

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Load Report by clicking button

Post by Alex K. »

Hello,

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

Thank you.
Post Reply