Solved

specify database location for Crystal Report Chart in VB at runtime

Posted on 2002-05-13
5
337 Views
Last Modified: 2012-08-13
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! :)
0
Comment
Question by:ahpui
  • 3
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 7007396
Yes there is.  What controls are you using in VB to call the report?

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
0
 

Author Comment

by:ahpui
ID: 7007461
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??
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 7008458
0
 

Author Comment

by:ahpui
ID: 7016798
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.
0
 

Author Comment

by:ahpui
ID: 7016799
not exactly what I am looking for but enough to get my problem solved. Thanks! :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now