Solved

Crystal Reports Sending SQL statement to report

Posted on 2000-03-13
2
197 Views
Last Modified: 2010-05-02
How do i create a report that I would be able to send a sql statement created by my program, and what is the syntax to do so.

Any code or examples would be great!

Thanks,
Geo90
0
Comment
Question by:geo90
2 Comments
 

Expert Comment

by:soosairaj
ID: 2615036
Dear friend..  
use like this. first create a general report.. while calling from Vb. pass like this arguments


occtype = "IN"
    str = "{Incidents_Monthly.Month}=" & MONTHVAL & "And {Incidents_Monthly.Year}=" & YEARVAL & "and {Incidents_Monthly.occurrence_type}='" & occtype & "'"

 CrystalReport2.SelectionFormula = str
 CrystalReport2.Formulas(0) = "MONTHNAME='" & Me!Month & "'"
    CrystalReport2.Formulas(1) = "yearvalue=" & Me!Year
   CrystalReport2.Destination = 0
    CrystalReport2.Action = 1




And also

CrystalReport2.ReportSource
 CrystalReport2.datasource

you can use..

Raj
 

0
 

Accepted Solution

by:
AshokKumar earned 50 total points
ID: 2615156
u have all the property essential to send parameters, formulae and even SQL query from VB to the Crystal Report. You have a property CrystalReport1.SqlQuery. Use this to pass Sql  query to your report. Remember all the fields from the query should match the report fields. This would work absolutely fine.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

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

22 Experts available now in Live!

Get 1:1 Help Now