PDA

Click to See Complete Forum and Search --> : Problem printing report!


majc
Oct 1st, 2006, 01:05 PM
Im using ADO connection, Visual Basic 6 and Crystal Reports 4.6.

Im trying to print some reports but nothing happens and dont give me any error.

This is my code:

Private Sub cmdImprimir_Click()

Dim rsRecordSet As Recordset
Set rsRecordSet = New Recordset

Formula = "{Facturas.Id_Factura} =" & Val(lblFact.Caption)

If (Val(lblIVA.Caption) = 5) And (Val(lblImprimir.Caption) = False) Then

frmImprimir.Show
frmImprimir.Hide

CrystalReport2.ReportFileName = App.Path & "\facturaio.rpt"
CrystalReport3.ReportFileName = App.Path & "\facturaid.rpt"
CrystalReport4.ReportFileName = App.Path & "\facturaivat.rpt"
CrystalReport5.ReportFileName = App.Path & "\reciboio.rpt"

End If

If (Val(lblIVA.Caption) <> 5) And (Val(lblImprimir.Caption) = False) Then

frmImprimir.Show
frmImprimir.Hide

CrystalReport2.ReportFileName = App.Path & "\facturao.rpt"
CrystalReport3.ReportFileName = App.Path & "\facturad.rpt"
CrystalReport4.ReportFileName = App.Path & "\facturat.rpt"
CrystalReport5.ReportFileName = App.Path & "\reciboo.rpt"

End If

CrystalReport2.SelectionFormula = Formula
CrystalReport3.SelectionFormula = Formula
CrystalReport4.SelectionFormula = Formula
CrystalReport5.SelectionFormula = Formula

CrystalReport2.PrintReport
CrystalReport3.PrintReport
CrystalReport4.PrintReport
CrystalReport5.PrintReport

End Sub

What i need to setup my crystal report objects manualy(with code and not in the properties)

Thanks in advance!

Hack
Oct 2nd, 2006, 06:07 AM
Moved to reporting section

Asgorath
Oct 2nd, 2006, 07:50 AM
Are you sure all reports are connected to the database?