Solved

Crystal Reports Sending SQL statement to report

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 192
using Access 8 83
How to debug this code 7 65
vb6, excel Run-time error 1004 method 'close' of object 'workbooks' failed 7 64
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

685 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