Scooby Dog
2010-03-10 22:26:56 UTC
Could someone help: I have a report that I have created using VB.net 2008
and a stored procedure. When I created the report I used the Database
Expert and connected to the database and then the stored proc. Is there a
way to set this at runtime?
Thanks
Dave.
Here is the web page that I use to display the report
----------------------------------------------------
<body>
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" ReportSourceID="CrystalReportSource1"/>
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="ActiveInq.rpt">
</Report>
</CR:CrystalReportSource>
</div>
</form>
</body>
Here is the code behind to populate the report:
-----------------------------------------------
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Partial Class PrintActiveInquiry
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
' Load the ID of the Inquiry.
Dim field1 As ParameterField =
Me.CrystalReportViewer1.ParameterFieldInfo(0)
Me.CrystalReportViewer1.BorderWidth = 100
Me.CrystalReportViewer1.HasCrystalLogo = False
Dim val1 As New ParameterDiscreteValue()
Dim ID As Integer = CType(Request.QueryString("ID"), Integer)
val1.Value = ID
field1.CurrentValues.Add(val1)
End Sub
and a stored procedure. When I created the report I used the Database
Expert and connected to the database and then the stored proc. Is there a
way to set this at runtime?
Thanks
Dave.
Here is the web page that I use to display the report
----------------------------------------------------
<body>
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" ReportSourceID="CrystalReportSource1"/>
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="ActiveInq.rpt">
</Report>
</CR:CrystalReportSource>
</div>
</form>
</body>
Here is the code behind to populate the report:
-----------------------------------------------
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Partial Class PrintActiveInquiry
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
' Load the ID of the Inquiry.
Dim field1 As ParameterField =
Me.CrystalReportViewer1.ParameterFieldInfo(0)
Me.CrystalReportViewer1.BorderWidth = 100
Me.CrystalReportViewer1.HasCrystalLogo = False
Dim val1 As New ParameterDiscreteValue()
Dim ID As Integer = CType(Request.QueryString("ID"), Integer)
val1.Value = ID
field1.CurrentValues.Add(val1)
End Sub