Public Shared Sub PrintReport(ByVal f As Form1)
Try
Dim vchrNo As String
'qty mode report is called: ReceiverVariance-CR11.rpt -- change config to QtyModeReport
'voucher mode report is called: APVoucherRecapReport-CR11 -- add to config VoucherModeReport
If Globals.QtyModeIndicator = True Then
fCRV.crvMain.ReportSource = Globals.QtyModeRept
'if clicked, let the report ask for a parameter else pass it a selection formula
If Not Globals.ReportCalledByClick Then
fCRV.crvMain.SelectionFormula = "{ag_ap_match_variance_report.pack_no} = " & Chr(34) & f.billNo.Text & Chr(34)
End If
fCRV.ShowDialog()
Else
fCRV.crvMain.ReportSource = Globals.VoucherModeRept
'if clicked, let the report ask for a parameter else pass it a selection formula
'get voucher number
Dim dr As DataGridViewRow = f.dgvVouchers.SelectedRows(0)
VchrNo = dr.Cells(1).Value.ToString
If Not Globals.ReportCalledByClick Then
fCRV.crvMain.SelectionFormula = "{aptrxfil_sql.vchr_no} = " & Chr(34) & vchrNo & Chr(34)
End If
fCRV.ShowDialog()
End If
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
End Sub
ASKER
ASKER
ASKER
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY
One way around this is to pass the report a dataset.
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx
Does the report run if you provide the connection information when asked?
mlmcc