
All I found was this old video http://www.telerik.com/clientsfiles/product.videos/28/ and I also read that you would have built in support for this in future releases. Any info on this?
9 Answers, 1 is accepted
Generally there are two distinct ways of getting the parameters values:
- Through your own user interface or any other means (e.g. query string).
- Through the report parameters defined in the ReportParameters collection of the report.
Using one of those does not necessarily involve the usage of the other one and it is up to you to choose the approach that would best suit your case. More info is available in this KB article.
As for the built-in support you mention, note that Telerik Reporting does not provide its own data layer but depends on the existing .NET objects (DataSet, Data Table, DataView, ADO.NET, lists - for more information on report data binding, please, refer to this help topic). Because of that, the Telerik Reporting Data Source Wizard cannot be used to connect to parameterized data source such as stored procedure or a Select command with parameters out of the box.
Sincerely yours,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

You can achieve that by using a subreport item.
Kind regards,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Currently I am using the following code:
ReportViewer1.Report =
New hedgepl
Dim repparam As hedgepl
repparam = ReportViewer1.Report
repparam.EndDate = DateTime.Now()
If I add a master with the name hedgeplmaster I guess it would look something like this:
ReportViewer1.Report =
New hedgeplmaster()
Dim repparam As hedgepl
repparam = ReportViewer1.Report [WHAT SHOULD I CHANGE HERE TO ACCESS THE SUB REPORT?]
repparam.EndDate = DateTime.Now()

ReportViewer1.Report =
New hedgeplmaster()
Dim Sub1 As Telerik.Reporting.SubReport
Sub1 = ReportViewer1.Report.Items(1).Items(0)
Dim repparam As hedgepl
repparam = Sub1.ReportSource
repparam.EndDate = DateTime.Now()
Does that look ok to you?

How can I get this SQLConnection to use one of my defined connectionstrings in my app.config settings?
If needed I could pass this from my application but I do not see how I could access the SQLConnection from my application. I can access the SQLDataAdapter by defining a SQLDataAdapter and pointing it to the right one by: SubReport.ReportSource.DataSource but I do not see how to create an SQLConnection object and then point it ti the SQL Connection that is present in the SubReport.
This is my last issue to get this to work :-)
Generally when you are using the Report Wizard to create the reports, you would go through a step that asks you to save the connectionString you use into your web/app config files. This way you can easily re-use it when creating other reports and changing it would affect the other ones as well. Here is also a code library that shows how to access the connectionStrings in your config files from your report constructor.
Note this is not specific to our product - any valid approach for .NET is applicable for the reports as they are standard .NET classes.
All the best,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Partial
Public Class trades
Inherits Telerik.Reporting.Report
Public Sub New
InitializeComponent()()
Me.TradesDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings("SQLCon").ConnectionString
'TODO: This line of code loads data into the 'TradesDataSet.TradesDataSetTable' table. You can move, or remove it, as needed.
Try
Me.TradesDataSetTableAdapter1.Fill(Me.TradesDataSet.TradesDataSetTable)
Catch ex As System.Exception
'An error has occurred while filling the data set. Please check the exception for more information.
System.Diagnostics.Debug.WriteLine(ex.Message)
End Try
End Sub
When I tried to run it with the new line in bold text above I get the error that object reference is not set to an instance of an object.
When I use the code below yesterday on another report it worked fine:
Partial
Public Class hedgepl
Inherits Telerik.Reporting.Report
Public Sub New()
InitializeComponent()
Me.SqlConnection1.ConnectionString = ConfigurationManager.ConnectionStrings("Reports.My.MySettings.stefantest").ConnectionString
End Sub
What is the difference between these two other than the fact that I am using an SqlConnection in the last example?
The difference between those two as described in the code library referenced in my previous post is that in the first case you have used the report wizard to generate typed dataset for you and you access it directly via TradesDataSetTableAdapter1.Connection.ConnectionString, while the second approach is when you setup the datasource on your own, creating SqlCommand, SqlConnection etc.
In this case you obviously do not have predefined dataset, so you need to set the connectionString to the SqlConnection:
SqlConnection1.ConnectionString = ConfigurationManager.ConnectionStrings("Reports.My.MySettings.stefantest").ConnectionString
"Object reference is not set to an instance of an object" is a generic framework error and you should debug to see what is causing it in order to correct the error.
Sincerely yours,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.