eazadi: there exists a Crystal Report object which in Visual Studio you can simply drop/drag onto the form. Do a little research on the net visiting sites specific for using Crystal Reports with ASP.NET (there are many threads here you can review as well (use the "Search" function here at this forum).
From what I have heard (I do not use Crystal Reports) it is a bit of work getting started but once you put in a 100 or so hours its worth the payoff.
HEllo everyone. I am trying to accomplish the same thing as eazadi. I have a sql stored procedure with dateclose parameter. Now to pass the value the user selects from calendar drop down control to the crystal report. I am using the push methods. Here what the form that has the crystal report viewer on it.
I call the BindReportToDS from the onload event of the page.
Sub BindReportToDS()
Dim myconnection As New SqlClient.SqlConnection
'myconnection.ConnectionString = "server=server;database=northwind;uid=guest;pwd=guest2"
' myconnection.ConnectionString = ("Data Source=DISYSTEMS;" & _
'"Initial Catalog=HelpDesk;user id=sa;password=password;")
myconnection = New SqlConnection(ConfigurationSettings.AppSettings("Connection").ToString)
Dim mycmd As New SqlClient.SqlCommand
mycmd.Connection = myconnection
mycmd.CommandType = CommandType.StoredProcedure
'mycmd.CommandText = "uspTicketClosedByMonth"
mycmd.CommandText = "Select * uspTicketClosedByMonth where "
If TextBox1.Text <> "" Then 'here I am reading the value of the date that pass from the previouspage where the user selects a date and store it in the Textbox1
mycmd.Parameters.Add("@dtDateClosed", CDate(TextBox1.Text))
Else
mycmd.Parameters.Add("@dtDateClosed", Now())
End If
Dim myda As New SqlClient.SqlDataAdapter
myda.SelectCommand = mycmd
Dim myDs As New OpenTicketsByMonth
myda.Fill(myDs, "uspTicketClosedByMonth")
mycmd.Dispose()
myconnection.Close()
' Set up a new instance of the Report
Dim oRpt As New rptClosedTicketsByMonth
oRpt.Load()
oRpt.SetDataSource(myDs)
CrystalReportViewer1.ReportSource = oRpt
myconnection.Close()
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.