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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report help!!!

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
0
0
GB
Can anyone help me to create a crystal report through VB?

All i'm wanting is to let the user click a button which then creates a crystal report WITH data from a flat text file which the user selected.

The only thing i know of is using the Crystal Report control but u need to specify a report to show.

Thanks for any info!!
 
Well, there are a couple ways to do this. The way that I have always used Crystal Reports is to use the RDC Component that you can install into VB, then creating a report with Crystal is just like using the Report Designer in VB only it is much more flexible. If you do it this way, when you create the report, it will prompt you if you want a form created containing the crystal report viewer, choose yes and it will create a form for you that you can just do form.Show and the form will load and contain the report. If you need to change the way that the form works, ie, you want to be able to show 2 reports at different times without creating 2 different forms, just check out the code in the form that was created and you will see how it works. Its very simple.

Now, as far as using a text file to load the report, i'm not sure exactly how to do it because I have always used Crystal with a database not a text file, but you should be able to put the code to read the file and input the data into the report in the form_load event of the form which contains the crystal report viewer.

You can also create the report in Crystal Reports and open it from VB, but i'm not sure how to do it, I always use the RDC Component. I hope this helps, I know its a little vague, but I just wanted to let you know what your options are. If you need more help, post back and i'll dig up some code when I get home that may be able to help.
 
Thanks for the info!

is it the Microsoft Remote Data control? as this is the only RDC component i can find!

If it is how do i go about to make the actual report like u said, where it asks whether i want a form creating containing the crystal report etc etc?

Cheers for ur help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top