ahpui
asked on
specify database location for Crystal Report Chart in VB at runtime
hi guys,
I use Crystal Report control in my VB app to plot a chart with data from a database (mdb) located at app.path. At design time I specified the database location inside Crystal Report Designer in VB like this:- "Designer -> Database Fields -> Set Locaton -> File: ChartData!.\DBName.mdb". I believe the ".\" equivalent to App.Path. And I plot the chart using Chart Expert at design time. This approach works fine in Windows 98, NT and 2000. However, in XP, it gives me the follow error: File could not be found: "ChartData", at file location: "ChartData". Is there anyway I can specify the DB location and plot the chart at runtime using VB code instead of at design time. Thanks in advance! :)
I use Crystal Report control in my VB app to plot a chart with data from a database (mdb) located at app.path. At design time I specified the database location inside Crystal Report Designer in VB like this:- "Designer -> Database Fields -> Set Locaton -> File: ChartData!.\DBName.mdb". I believe the ".\" equivalent to App.Path. And I plot the chart using Chart Expert at design time. This approach works fine in Windows 98, NT and 2000. However, in XP, it gives me the follow error: File could not be found: "ChartData", at file location: "ChartData". Is there anyway I can specify the DB location and plot the chart at runtime using VB code instead of at design time. Thanks in advance! :)
ASKER
yes, I use RDC.
After I specified the location of the Database, how can I plot the chart programmatically? At design time I can use the Chart Expert but how about at runtime??
After I specified the location of the Database, how can I plot the chart programmatically? At design time I can use the Chart Expert but how about at runtime??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mlmcc,
I found out from one of the articles on the site you gave me. This is all I needed:
Report.Database.Tables(1). Location = "C:\myDatabase.mdb"
Thanks!
Still can't find anything about plotting a chart programmatically though. If you have any information on that please let me know. Later.
I found out from one of the articles on the site you gave me. This is all I needed:
Report.Database.Tables(1).
Thanks!
Still can't find anything about plotting a chart programmatically though. If you have any information on that please let me know. Later.
ASKER
not exactly what I am looking for but enough to get my problem solved. Thanks! :)
It sounds like the RDC.
The RDC object has a SetDataSource method.
This link may help
http://support.crystaldecisions.com/library/kbase/articles/c2002296.asp
mlmcc