This is a migrated thread and some comments may be shown as answers.

How to capture Preview button click for a Report with parameters.

3 Answers 481 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 26 Sep 2011, 03:48 PM
Hello All -
This is my first foray into Telerik Reports and while I've done some reading on how to get started, please bear with me if I do ask something that is fairly basic.

Here is what I want to do -
I have a Stored Procedure that has 2 input params and returns me a set of records, I display this in a Report (table) and then I want to chart the output.

Now, when charting (pie chart) I first want to filter my data, i.e. not all rows from the SP output need to make it to the chart. To do this, I create a Custom report and in the constructor for the report I make the SP call, get the data into a Dataset and then use a DataView to filter out what I want. But bear in mind that the End User can select parameters to run the report (the 2 input params to the SP) and then click the Preview button to pull the data, however in doing so the report just shows the old data, for I have not captured the Preview button click and wired it into my Logic for filtering data.

How do I go about doing this?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 28 Sep 2011, 05:38 PM
Hello Rakesh,

In Q1 2010 we have introduced datasource components that have full parameters design time support. 

Check out the Using Stored Procedures in Telerik Reporting with the SqlDataSource Component video that elaborates on the topic.

Best wishes,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Rakesh
Top achievements
Rank 1
answered on 29 Sep 2011, 09:40 PM
Peter - Thank you for your reply, but it does not answer my question.

I'm able to connect to a Stored Proc from my report to pull data, my question was this - If I need to manipulate the data from the SP before I display it, I would obviously need to tap into the Preview Button click event on the Report page. I wanted to know if it was possible to do that, i.e. add a handler for the Preview Button.
I'm asking this because I have a SP and do not wish to change the SP based on the data I wish to display. The manipulations I've in mind cannot quite be accomplished via the Filter property for the report.
0
Peter
Telerik team
answered on 04 Oct 2011, 02:07 PM
Hi Rakesh,

The preview button click event is only available for the Windows forms report viewer. If you use another report viewer our suggestion is to handle the Report.NeedDataSource event. Check out Using the NeedDataSource event to connect data help article.

Kind regards,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Peter
Telerik team
Rakesh
Top achievements
Rank 1
Share this question
or