Dear All
i am developing .Net Application with MS Access and Crystal Report
i am using DSN for crystal report to view the data from database. on each new client i have to go there to make DSN and then crystal reoport work, my application forms using database through physical connection string,
i have managed query in my crystal report and then that command represent the data into crystal reports. everything working fine. my question is can i provide crystal report database source at runtime where is my database installed in application folder, so client just download my software and can place anywhere to use the software and crystal reports here is my code
Public ReportName As String
Dim cryReportDoc As New ReportDocument
Public StartDate, EndDate, Criteria1, Criteria2 As String
Private Sub Report_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "(" & Me.ReportName & ") " & Me.Text
If Me.ReportName = "DayBookReport" Then cryReportDoc = New DayBookReport
If Me.ReportName = "DayBookReport" Then cryReportDoc.SetParameterValue("Criteria2", Criteria2)
If Me.ReportName = "DayBookReport" Then
cryReportDoc.SetParameterValue("Criteria1", Criteria1)
cryReportDoc.SetParameterValue("StartDate", StartDate)
cryReportDoc.SetParameterValue("EndDate", EndDate)
End If
CryControl.ReportSource = cryReportDoc
End Sub