I am Having a really difficult time with this, it seems like it should be so simple. I wish there were better/more complete examples. It seems a lot of post about this but not a lot of info.
Here is what I am trying to do. I have an aspx page with a report viewer control. I have a simple report built in it's own class that has a SqlDataSource. The SqlDataSorce have one parameter for the record ID. In my aspx page I get a QueryString for the records ID and want to pass it to the SqlDataSource. I have tried both the Report Parameter method and trying to pass straight to the SqlDataSource.
Here is my code in my report that sets the SQL Param:
And Here is what I have on my aspx page:
Thanks,
Craig
Here is what I am trying to do. I have an aspx page with a report viewer control. I have a simple report built in it's own class that has a SqlDataSource. The SqlDataSorce have one parameter for the record ID. In my aspx page I get a QueryString for the records ID and want to pass it to the SqlDataSource. I have tried both the Report Parameter method and trying to pass straight to the SqlDataSource.
Here is my code in my report that sets the SQL Param:
Public
Property
Param1()
As
Integer
Get
Return
DirectCast
(
Me
.SqlDataSource1.Parameters(
"@wo_id"
).Value,
Integer
)
End
Get
Set
(
ByVal
value
As
Integer
)
Me
.SqlDataSource1.Parameters(
"@wo_id"
).Value = value
End
Set
End
Property
And Here is what I have on my aspx page:
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
Dim
wo_id
As
String
= Request(
"wo"
)
Dim
rpt =
New
WorkRequestRpt()
Dim
instanceReportSource =
New
Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = rpt
rpt.Param1 =
CInt
(wo_id)
Me
.ReportViewer1.ReportSource = instanceReportSource
'New WorkRequestRpt()
ReportViewer1.RefreshReport()
End
Sub
This is slight different than the examples I saw because I kept getting an error that certain methods were now obsolete.
Every time I open the report it is just blank. I don't know if I need to use the Need_DataSource event or what. Also, do I need some parameter on the report? If I remove the parameter and just have a straight query it work fine. Something is not passing the vale to the SqlDataSource.
A real good example with all of the steps would be great (the video is hard to follow, especially with some of the methods becoming obsolete). I think it would also help a lot of other out.
Thanks,
Craig