Slno | Name | Star | Qty | Rate | Amount(these are in grid).i need to get print after click save button,print button there.i have query in sql 2000 and code in vb6.pls give answer
CREATE PROCEDURE sp_rptVazhipadReceiptslip(@intVazhSaleCode as int) AS
Begin
Select
SH.VazhSaleCode,
SH.VazhSlipNo,
SH.SaleDate,
SH.PersonName,
SH.NashatraCode,
SH.VazhDate,
SH.ToatlAmount,
SD.Qty,
SD.Rate,
SD.NetAmount,
NM.NashatraName,
IT.VazhMalName ,NM.MalNashatraName
FROM
VazhipadItemSaleHdr SH
INNER JOIN
VazhipadItemSaleDtl SD
ON
SH.VazhSaleCode = SD.VazhSaleCode
INNER JOIN
VazhipadItemMal IT
ON
IT.VazhipadCode=SD.VazhipadCode
LEFT JOIN
NarashatramMaster NM
ON
NM.NashatraCode=SH.NashatraCode
WHERE
SH.VazhSaleCode=@intVazhSaleCode
--SH.NashatraCode=@intNashatraCode
End
code in vb6 below mentioned
Private Sub cmdPrint_Click()
On Error GoTo err
Dim intPrint As Integer
intPrint = 1
If frmMain.chkPrintBill <> vbChecked Then
If MsgBox("Print Bill", vbInformation + vbYesNo, App.Title) = vbNo Then Exit Sub
End If
While Not intPrint > CInt(txtNoofPrint)
If chkReceipt2 <> vbChecked Then
With frmMain.crpt
.Reset
' .WindowParentHandle = frmMain.hwnd
.ReportFileName = ReportPath & "\rptReceiptNo.rpt"
.StoredProcParam(0) = objVazhItemSale.lngVazhSalesCode
'.StoredProcParam(0) = objVazhItemSale.intNarashatraCode
'.Destination = crptToPrinter
.Destination = crptToWindow
.Action = 1
End With
Else
With frmMain.crpt
.Reset
' .WindowParentHandle = frmMain.hwnd
.ReportFileName = ReportPath & "\rptReceiptNo2.rpt"
.StoredProcParam(0) = objVazhItemSale.lngVazhSalesCode
.Destination = crptToPrinter
.Action = 1
End With
End If
intPrint = intPrint + 1
Wend
intPrint = 0
Exit Sub
err:
ErrorHandler err.Number
End Sub