Dim e As RequestEventArgs = args(0)
Dim oid As String
If e.GetValues.ContainsKey("oid") Then
oid = e.GetValues("oid")
Else
Return ""
End If
vars("company_name")= e.Cookies("cookcompanyname") \'取出cookies 中的企业名称
Dim Book As New XLS.Book(ProjectPath & "Attachments\\po_purchase.xls")
Dim sheet As XLS.Sheet = Book.Sheets(0)
Dim fl As String = ExcelPath & "ExcelReport\\po_purchase.xls"
book.AddDataTable("采购主档","jyapp","Sel ect * fro m {poOrderMaster} inner join {suppliers} on {poOrderMaster}.po_supp_id={suppliers}.sbh01 where po_id= \'" & oid & "\'") \'添加父表
book.AddDataTable("采购明细","jyapp","Sel ect *,po_isl * po_idj As po_ijr fr om {poOrderLine} where po_id= \'" & oid & "\'") \'添加子表
book.AddRelation("采购主档","po_id","采购明细","po_id") \'建立关联
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.Code = oid
Bar.QuietZoneWidth = 2
Bar.DisplayChecksum = False
Bar.SaveImage(BarPath & "bar\\po_id.wmf",300)
book.save( fl )
e.WriteBook(book, oid & ".xls",False)