Monday, March 19, 2012

Crystal Reports

Hello out there,

I have a problem with crystal reports. I have added the report from VB6. This is the code in the Form Section

Visual Basic 6 Code:
------------
Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

strSelectString = "{M_Receipt.PayMtd} = 'Credit Card' "

CrystalReport1.RecordSelectionFormula = strSelectString

End Sub
------------
end of Visual Basic 6 Code

This code still gives me all the records from the database. I connected to the DSN in the Crytal report itself using Database-->Set Location, then pointing to my DSN.(Connecting to an Access Database)

How can i resolve this so that only the records i want are displayed.

ThanksMillions in advance[ Moved to Crytal Report forum]|||Add parameters in the said crystal report, use these parameters in the Report Selection option.

Pass values to the crystal report from the VB script.

Sample way of passing parameters is as below :

For eg., the parameter name is vPayMtd.

CrystalReport1.Parameterfields(0) = 'vPayMtd;' & 'Credit Card' & ';true'

Here if want to pass a value in the condition of comparision
of vPayMtd = 'Credit Card', above notation can be used.

Try with this.|||Hi Friends,

m new to crystal reports and facing some problems regarding the same

i made one rpt in crystal rpts.
and now want to call it in vb 6

the coding which i have used is as follows.

frmemp.crystalreport1.connect = "dsn,uid,pwd"
frmemp.crystalreport1.reportfilename = "c:\programe files\..\empdtl.rpt"
frmemp.crystalreport1.action = 1

m i missing out something,

please guide me for this query.

regards,
kalpana

No comments:

Post a Comment