Hi,
You can pass a SQL to CR using the Crystal Report Control available as a component in VB. Just include that in your project. It has a property called SQLQuery or something similar. Just assign it the query and open the report. Assuming it to be SQL, it would work like this:
Crystal1.SQLQuery= queryString
where Crystal1 is the name of the CR component that you are using.
Hi,
Continuing with my previous reply, you can use the following piece of code:
Crystal1.ReportTitle= "Title of Report - Its your choice"
Crystal1.Connect= cn 'Name of the active connection
Crystal1.ReportName='Location of the report including'
Crystal1.DiscardSavedData=1
Crystal1.Action=1
Crystal1.Reset
Sir/Ma'am
I've already done that but nothing happens
I made a program at VB6 an a report at Crystal report 4.6
i call my reports in vb6 in these format:
With CrystalReport1
.ReportFileName = "PAth And The RPT File"
.DiscardSavedData = True
.SqlQuerry="StringQuerry"
.Action = 1
End With
Is there something wrong with this.
Plsss. Somebody HELP I really need it.
I am working on something similar at the moment, But do it slightly differently :
With cr212 'The vb crystal object
.ReportFileName = strRptFile
.SQLQuery= " Select * from Whatever"
.Destination = crptToWindow
.PrintReport
End With
Basically... What report
What query
Where to? (To file, to window, to printer)
And Do it now
PrintReport returns a value. If you put a break on this it will show an error number if it fails that you can look up in CR Help to find out why.
I am working on something similar at the moment, But do it slightly differently :
With cr212 'The vb crystal object
.ReportFileName = strRptFile
.SQLQuery= " Select * from Whatever"
.Destination = crptToWindow
.PrintReport
End With
Basically... What report
What query
Where to? (To file, to window, to printer)
And Do it now
PrintReport returns a value. If you put a break on this it will show an error number if it fails. You can look up the error number in CR Help to find out why.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.