PDA

Click to See Complete Forum and Search --> : creating a report programatically (VB.NET 2005)


colonel720
Nov 6th, 2006, 03:35 PM
Language = VB.NET 2005

I have an sql database which is the source of my reporting front-end. the reports are predesigned in visual studio, but when the front end app opens a table or a view, I want to place the data from the table or view into the report, with a default header and footer. My questions are:

A) how can i dynamically change the source server, database, and table/view/procedure that the report is generated from, and then dynamically add the appropriate text/label/picture objects to the crystalreports.engine.reportdocument object at runtime?

B) the program has a feature where if one server is down, it can revert to a backup server. to this, i need to change the source server on a reportdocument after it has been loaded. this is probably the same solution as problem A.


thanks for any help

shakti5385
Nov 6th, 2006, 09:01 PM
how can i dynamically change the source server, database, and table/view/procedure that the report is generated from, and then dynamically add the appropriate text/label/picture objects to the crystalreports.engine.reportdocument object at runtime?

you can use the parameter for this purpose, so in the parameter you can pass the value and able to change the value run time also.
If you want to know more detail about this then just click on the link at my signature how to add dynamic column in the crystal report. This article for the VB and CR but it is related to the CR so check it.

Related to the vb.net
You can pass parameter values to a crystal report programmatically using ReportDocument.DataDefinition.ParameterFields member, which represents a collection of parameters associated with a report.
Just check the link at my signature parameter in the crystal report. :wave: