S
slY
hi all!
I'm trying to link a SQLDataSource to a Reportview dinamically in this way:
in Print.aspx I set
<rsweb:ReportViewer ID="RptViewFoo" runat="server" Font-Names="Verdana"
Font-Size="8pt"
Height="400px" Width="966px">
<LocalReport ReportPath="Print\Foo.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="SQLDSFoo" Name="Report_Foo" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="SQLDSFoo" runat="server" ConnectionString="<%$
ConnectionStrings:_FOO_ConnectionString %>"
then, in the code behind I use code like
....
ElseIf (stampType = "Foo") Then
If Not (IDUser = "") Then
Try
SQLDSFoo.SelectParameters.Clear()
SQLDSFoo.SelectParameters.Add("id_user",
Type.GetTypeCode(Type.GetType("Integer")), IDUser) 'IDUser is loaded via
Query-String
SQLDSFoo.SelectCommand = "SELECT * FROM [PRINT_FOO] AS X WHERE
X.id_user = @id_user"
SQLDSFoo.Select(Nothing)
RptViewFoo.DataBind()
SQLDSFoo.UpdateParameters.Clear()
SQLDSFoo.UpdateParameters.Add("id_user",
Type.GetTypeCode(Type.GetType("Integer")), IDUser)
SQLDSFoo.UpdateCommand = "dbo.procedure_UDPATE_FOO_PRINTED @id_user"
...
Does it make sense?
Sorry, but I cannot use debug mode with this project!
I'm trying to link a SQLDataSource to a Reportview dinamically in this way:
in Print.aspx I set
<rsweb:ReportViewer ID="RptViewFoo" runat="server" Font-Names="Verdana"
Font-Size="8pt"
Height="400px" Width="966px">
<LocalReport ReportPath="Print\Foo.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="SQLDSFoo" Name="Report_Foo" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="SQLDSFoo" runat="server" ConnectionString="<%$
ConnectionStrings:_FOO_ConnectionString %>"
></asp:SqlDataSource>
then, in the code behind I use code like
....
ElseIf (stampType = "Foo") Then
If Not (IDUser = "") Then
Try
SQLDSFoo.SelectParameters.Clear()
SQLDSFoo.SelectParameters.Add("id_user",
Type.GetTypeCode(Type.GetType("Integer")), IDUser) 'IDUser is loaded via
Query-String
SQLDSFoo.SelectCommand = "SELECT * FROM [PRINT_FOO] AS X WHERE
X.id_user = @id_user"
SQLDSFoo.Select(Nothing)
RptViewFoo.DataBind()
SQLDSFoo.UpdateParameters.Clear()
SQLDSFoo.UpdateParameters.Add("id_user",
Type.GetTypeCode(Type.GetType("Integer")), IDUser)
SQLDSFoo.UpdateCommand = "dbo.procedure_UDPATE_FOO_PRINTED @id_user"
...
Does it make sense?
Sorry, but I cannot use debug mode with this project!