Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Crystal Reports Sending SQL statement to report

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
geo90
Asked:
geo90
1 Solution
 
soosairajCommented:
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
 
AshokKumarCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now