I've created a report with crystal reports in vs 2008.
In the ide, the report uses an Access 2003 database for the report datasource. I display the report using a crystalreportviewer control.
I created the report using a development database.
When the app is moved to production, I want the report to use the production db. How do I set the datasource for the report and any subreports? Does it have to be done with code, or can the datasource for the report be changed at design time. I've had some success with the main report, but I can't change the subreport datasource.
Also, how do I retrieve the current datasource for a report?
The code I use to open the report:
In the ide, the report uses an Access 2003 database for the report datasource. I display the report using a crystalreportviewer control.
I created the report using a development database.
When the app is moved to production, I want the report to use the production db. How do I set the datasource for the report and any subreports? Does it have to be done with code, or can the datasource for the report be changed at design time. I've had some success with the main report, but I can't change the subreport datasource.
Also, how do I retrieve the current datasource for a report?
The code I use to open the report:
VB.NET:
Private Sub fReportsEquipmentProposals_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim crReport As New ReportDocument
Dim crReportName As String
crReportName = My.Settings.ReportPath & "\" & "EquipmentProposal.rpt"
crReport.Load(crReportName)
crReport.SetDataSource(My.Settings.SCPConnection)
crReport.SetParameterValue("ConfigId", ConfigId)
CrystalReportViewer.ReportSource = crReport
end sub