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

how to get dynamic reports

3 Answers 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Y L
Top achievements
Rank 1
Y L asked on 28 Sep 2010, 08:03 PM
Hello there,

So now my project can produce reports successfully, what I want to do is when users select different calendars, they will see different reports which have the events selected from the different calendars.  I use Request.Cookies("checkedCalendars").Value in my web application code. How can I pass the cookie "checkedCalendars" to my Report.Designer.vb file, in which i  have
Me.SqlDataSource1.SelectCommand = "SELECT  Subject, Start, [End], aLocation" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM  tblActivities WHERE aCalendarID IN ("checkedCalendars") ;"  ?

How can i do this?

Thank you very much.  

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Sep 2010, 04:32 PM
Hello Y L,

You can use the Report Parameters for such scenarios. More information is available in the Using Report Parameters programmatically.

Kind regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Y L
Top achievements
Rank 1
answered on 30 Sep 2010, 04:41 PM
Thank you Steve.

I checked the links you mentioned. However, I don't think they are quite similar to my case. In my project, I'm trying to pass Request.Cookies("checkedCalendars").Value which is in my .aspx.vb file   to my Report.Designer.vb file, in which i  have
Me.SqlDataSource1.SelectCommand = "SELECT  Subject, Start, [End], aLocation" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM  tblActivities WHERE aCalendarID IN ("here should be the cookie checkedCalendars") ;"

Any help will be appreciated.

.
 
0
Steve
Telerik team
answered on 06 Oct 2010, 12:46 PM
Hi Y L,

The solution is straight-forward:

Me.SqlDataSource1.SelectCommand = "SELECT  Subject, Start, [End], aLocation" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM  tblActivities WHERE aCalendarID IN FormatArray(DirectCast(Me.ReportParameters("checkedCalendarsReportParameter").Value, ArrayList)) + ") "

where FormatArray is a user function that separates the multiple values. You can see this function in our ProductLineSales demo report (should open the Visual Studio examples and the actual report to see the code).

Additionally, since Q2 SP1 2010, we handle multivalue report parameters as Value for SqlDataSourceParameters internally, so you might want to setup this through the report designer in the same manner the chart items in the ProductLineSales report are bound.

All the best,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Y L
Top achievements
Rank 1
Answers by
Steve
Telerik team
Y L
Top achievements
Rank 1
Share this question
or