Make a report from a sql statement in VB 2010 with Crystal reports

DJ_Consulting
DJ_Consulting used Ask the Experts™
on
Looking for some examples of how to create a Crystal report from a sql statement that I currently use in VB.   The sql server is local to the machine that runs the program.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Consultant
Top Expert 2016
Commented:
hi..
Usually you will link Data Tables to your report using Database Expert. Do the same in Database Expert, select the Database and you can see Add Command. Select that and click on > button. You will get a Window, write your SQL Query there and press OK.

See the image below for your reference.

Example that how to get fields from sql statement to report viewer
Add Command

After finishing this you can see Command in Database Fields which contains all your records got from the SQL Query as result.

Hope this helps you. Try and get back with results.

Author

Commented:
I might not have asked this question correctly.    I already have the data in a dataset inside of my existing VB program.     Currently upon form submit, I pull a query and write it to a csv file before emptying the db.   In addition, to the csv file being written, I'm trying to add code that would send this dataset to a crystal report for manipulation (summaries and some formatting).
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Éric MoreauSenior .Net Consultant
Top Expert 2016

Commented:
have you checked the link I have already provided (http://emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx). It does exactly this (pushing a dataset to a report)

Author

Commented:
Yes I've gone through the link and get to the part where it is time to do testing, and I'm not sure how to implement the code.
Éric MoreauSenior .Net Consultant
Top Expert 2016

Commented:
try the downloadable sample

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial