| Charles A. Lackman 2005-05-25, 8:58 pm |
| Hello,
Before the form loads create a new instance of the CrystalReport and all its
properties. Most of the time it is better to use a dataset that is filled
with the data from the database instead of running the CrystalReport in a
connected state (connected to the database).
Dim TheCrystal as New MyCrystalReport
TheCrystal.SetDataSource(ADataset) ' If using a dataset to populate the
report/I believe you can also use the file location "C:\database1.mdb"
Form1.CrystalReportViewer1.ReportSource = TheCrystal
Form1.ShowDialog()
When using Crystal Reports and Datasets you have to create a dataset from
inside the VS designer then populate the dataset before you send it to the
report. After you have created the dataset, Crystal Reports will allow you
to see it inside the designer and place the fields onto the Crystal Report.
Hope this helps,
Chuck
"mf_sina" <mf_sina@yahoo.com> wrote in message
news:un5iIR1XFHA.1240@TK2MSFTNGP14.phx.gbl...
Hi all
i have a form and a crystalreportviewr control on that form.
crystalreport1 is my report which must use database1.mdb as it's datasource.
now how can i set the database path of my crystal report from code when form
loads?
(i'm using VB .Net)
thanks
|