Question Change datasource for crystal report using MS Access mdf file

dawatson

Member
Joined
Sep 15, 2008
Messages
18
Programming Experience
10+
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:
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
 
Change datasource for cystal report using MS Access mdf file RSS

I've discovered how to do this in design mode.
But I would like to know how to do it in code also.
 
hi,

I see you solved this problem using designer mode!!

can you post this solution?

I got the same problem and I just can't find the answer!!!

I'm already looking for 2 weeks and it's making me crazy!!!

greetz
 
Back
Top