Solved

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

Posted on 2014-02-25
6
346 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

867 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

16 Experts available now in Live!

Get 1:1 Help Now