Solved

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

Posted on 2014-02-25
6
345 Views
Last Modified: 2014-03-02
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.
0
Comment
Question by:DJ_Consulting
  • 3
  • 2
6 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 39887583
0
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 39888047
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.
0
 

Author Comment

by:DJ_Consulting
ID: 39898724
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).
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 69

Expert Comment

by:Éric Moreau
ID: 39898968
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)
0
 

Author Comment

by:DJ_Consulting
ID: 39899348
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.
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 39899407
try the downloadable sample
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

759 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