TysonLPrice
Programmer
I’m converting some Crystal reporting functions from VB 6.0 to VB .Net 2008, have reports up and running, and I’m not quite sure how to approach one aspect. The issue I have is most of the Crystal reports connect to a database and run a stored procedure. The connection properties are set up in the report usually pointing at the development region. At run time I need to be pointing to either development, user acceptance, or production. I know what environment I’m in from a configuration file but don’t know how to go about telling Crystal what environment and stored procedure to point at. In VB 6.0 it was:
Where A.ReportServer and A.ReportManhattanDB contain the connection poperties. The stored procedure is passed via:
Where rptSI40SR is the stored procedure. I’ve been Googling and most of the solutions seem to be working reports in Visual Studio with the Crystal and SP interfaces in the project. The reports I am working with are already developed and are in Crystal 8.5.
I’m hoping someone has already gone down this path or can point me in the right direction. This is what I have now but don’t know how to connect
Code:
CR1.Connect = "DSN=" & A.ReportServer & ";<<Use Integrated Security>>;DSQ=" & A.ReportManhattanDB
Code:
cr1.DataFiles(0) = A.ReportManhattanDB & ".dbo.Proc(rptSI40SR;1)
I’m hoping someone has already gone down this path or can point me in the right direction. This is what I have now but don’t know how to connect
Code:
myConnection = New SqlConnection("Data Source=devsql\tpa1;Integrated Security=SSPI;" & _
"Initial Catalog=Manhattan;")
MyCommand.Connection = myConnection
CryRepControl1.ReportFileName = "C:\CrystalReports\pkclaim.rpt"
CryRepControl1.ParameterFields(0) = "@pkEmployerAddress;3356342;true"
RptViewer1.ParameterFieldInfo = CryRepControl1.ParamFields
‘Need to override what’s in the Crystal report
‘If multiple parameters the are strung here and fed to crystal
RptViewer1.ReportSource = CryRepControl1.CrySet()