Loorenaa
Aug 16th, 2006, 12:38 PM
Hello I have a question about how to print a crystal reports from vb6.0
Form1.crtRpt.Connect = "DSN=dsn;UID=sa;PWD=pwd;DSQ=Admin"
Form1.crtRpt.StoredProcParam(0) = 2
Form1.crtRpt.ReportFileName = "C:\MyDocuments\BarCode.rpt"
Form1.crtRpt.Destination = crptToPrinter
Form1.crtRpt.Action = 1
this works fine.. but I want to print the report after a stored procedure is executed..
sQuery = " {call spGeneraTicket(?) } "
Set RdPrepst = gConn(0).CreatePreparedStatement("", sQuery)
RdPrepst.rdoParameters(0) = ticketID
Set rdResultado = RdPrepst.OpenResultset
nombreForma.crtRpt.StoredProcParam(0) = ticketID
nombreForma.crtRpt.ReportFileName = "C:\My Documents\BarCode.rpt"
nombreForma.crtRpt.Destination = crptToPrinter
nombreForma.crtRpt.Action = 1
but I get an error on the StoredProcParam(0) it's says object not supported..
thanx for your help :duck:
Form1.crtRpt.Connect = "DSN=dsn;UID=sa;PWD=pwd;DSQ=Admin"
Form1.crtRpt.StoredProcParam(0) = 2
Form1.crtRpt.ReportFileName = "C:\MyDocuments\BarCode.rpt"
Form1.crtRpt.Destination = crptToPrinter
Form1.crtRpt.Action = 1
this works fine.. but I want to print the report after a stored procedure is executed..
sQuery = " {call spGeneraTicket(?) } "
Set RdPrepst = gConn(0).CreatePreparedStatement("", sQuery)
RdPrepst.rdoParameters(0) = ticketID
Set rdResultado = RdPrepst.OpenResultset
nombreForma.crtRpt.StoredProcParam(0) = ticketID
nombreForma.crtRpt.ReportFileName = "C:\My Documents\BarCode.rpt"
nombreForma.crtRpt.Destination = crptToPrinter
nombreForma.crtRpt.Action = 1
but I get an error on the StoredProcParam(0) it's says object not supported..
thanx for your help :duck: