pinheiroa
asked on
Get the report with crystal 8
Hello,
I'm trying to print a report using Crystral 8. In VB I've this code:
Private Sub Command1_Click()
Me.CR.SelectionFormula = "{FACTURA.num_factura}=frm factura.te xtbox1.tex t"
Me.CR.Action = 1
End Sub
Private Sub Form_Load()
Me.CR.ReportFileName = "D:\dev\InFactu\proGym\Rep orts\Factu ra.rpt"
End Sub
The problem is that I get the report, but without any data. What wrong / missing.
Pls help me! Thanks.
I'm trying to print a report using Crystral 8. In VB I've this code:
Private Sub Command1_Click()
Me.CR.SelectionFormula = "{FACTURA.num_factura}=frm
Me.CR.Action = 1
End Sub
Private Sub Form_Load()
Me.CR.ReportFileName = "D:\dev\InFactu\proGym\Rep
End Sub
The problem is that I get the report, but without any data. What wrong / missing.
Pls help me! Thanks.
Maybe your report is not attached to the right DB or theres no data to be shown
Read craefully the whole page this should help
https://www.experts-exchange.com/questions/20716911/Crystal-report-accessing-using-VB.html
https://www.experts-exchange.com/questions/20716911/Crystal-report-accessing-using-VB.html
currently the report is only showing records, where the field {FACTURA.num_factura} has the value "frmfactura.textbox1.text" . you need to place the frmfactura.textbox1.text outside the string literal.
so try chaning this lineMe.CR.SelectionFormula = "{FACTURA.num_factura}=frm factura.te xtbox1.tex t"
to something simliar to this if the field value is a number
Me.CR.SelectionFormula = "{FACTURA.num_factura}= " & frmfactura.textbox1.text
or if it's a string
Me.CR.SelectionFormula = "{FACTURA.num_factura}= '" & frmfactura.textbox1.text & "'"
so try chaning this lineMe.CR.SelectionFormula
to something simliar to this if the field value is a number
Me.CR.SelectionFormula = "{FACTURA.num_factura}= " & frmfactura.textbox1.text
or if it's a string
Me.CR.SelectionFormula = "{FACTURA.num_factura}= '" & frmfactura.textbox1.text & "'"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.