I prepared the PO format using crystal reports. The crystal report is picking the data from a stored procedure in SQL 2005. As I could not link it to the print button on PO Entry form so I put it as a report under purchase management.
When the user opens the report it prompts for the PO Number and if the PO is approved then it displays the PO in a PDF format.
Please let me know
01. How I could connect this crystal report to the print button on the PO Entry form?
02. How I could print the PO which is opened in the PO Entry form without prompting for the PO Number
The stored procedure is as below
ALTER Procedure [dbo].[spPO]
@PONum int
as
BEGIN
select Vendor.Name, Vendor.address1, Vendor.address2, Vendor.address3, Vendor.city,
Vendor.state, Vendor.zip, Vendor.countrynum, country.description, Vendor.phonenum, Vendor.faxnum, Vendor.character01,
Vendor.character02,vendor.emailaddress,
Vendcnt.name, Vendcnt.phonenum, Vendcnt.cellphonenum,
POHeader.ponum, POHeader.orderdate, POHeader.character02, POHeader.character03, POHeader.character04,
POHeader.character05, POHeader.character06, POHeader.character07, POHeader.character08, POHeader.character09,
POHeader.character10, POHeader.checkbox01, POHeader.checkbox02, POHeader.checkbox03, POHeader.checkbox04,
POHeader.checkbox05, POHeader.checkbox06, POHeader.checkbox07, POHeader.checkbox08, POHeader.checkbox09,
POHeader.checkbox10, POHeader.checkbox11,POHeader.approvalstatus,FOB.Description,shipvia.description,Purterms.description,currency.documentdesc,PODetail.poline, PODetail.partnum, PODetail.venpartnum, PODetail.linedesc, PODetail.pum,
PODetail.orderqty, PODetail.docunitcost,poheader.commenttext,poheader.character01
from POHeader
Join PODetail
on POHeader.PONum = PODetail.ponum
Join Vendor
on POHeader.vendornum = vendor.vendornum
Join Vendcnt
on (POHeader.vendornum = vendcnt.vendornum and POHeader.prcconnum = vendcnt.connum)
join FOB
on POHeader.fob = FOB.fob
join Purterms
on POHeader.termscode = PurTerms.termscode
join Currency
on POHeader.currencycode = Currency.Currencycode
join ShipVia
on POHeader.shipviacode = Shipvia.Shipviacode
join Country
on Vendor.Countrynum = Country.Countrynum
where POHeader.ponum = @PONum
END