Solved

Crystal Reports Sending SQL statement to report

Posted on 2000-03-13
2
196 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

747 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

10 Experts available now in Live!

Get 1:1 Help Now