Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Viewer

Status
Not open for further replies.

levinll

Programmer
Oct 29, 2001
65
US
I'm trying to upgrade the way I call Crystal from within my VB application, so I can use the Crystal Report Viewer. However, I'm unsure which components/references I need to choose.

When I try to run my application I get an error on the following lines of code.

Public CrystalApplication As New CRAXDRT.Application
Public CrystalReport As CRAXDRT.Report

The error message is "User defined type not defined.
 
did you do these in VB
under References choose Crystal Report 9 (orwhateverversion) Designer Design and Runtime
under Components choose Crystal Report Viewer Control

then just right click on the project to add active form which is the Crystal Report. Those code you have above is ONLY use for when you use Crytal Report make a report then save it and import it into the VB6. that is a bad way to design since VB6 always have to know where your file is at. Using activex when you make .exe the report is in there already no need to worry about location
 
tdong:

"that is a bad way to design since VB6 always have to know where your file is at."

I disagree completely with that statement. If you use the built-in designer, you'll have to recompile your code every time a change needs to be made to a report, or a report needs to be added to the application.

If you are the developer/deployer of the application, then you have control over where those files are kept (say, a folder named Reports in the application's directory). Or, as we've done in our main app, store the reports in the database, and download them to the client as needed. The application can look in that directory (or the database) at runtime and show the client what reports are available.

This also gives the clients the ability to create their own reports, and have them available to run from the application.

"Canned" reports are great, until they need to be edited.

-dave
 
Heheh I shouldn't have said that there are advantage and disadvatage it depends on what you want to use it my bad. but that was beside the point the point is does your code work yet hehehe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top