请教:统计条件如何填充到Excel报表中?报表主页代码如下:
Dim e As RequestEventArgs = args(0)
Dim date1,Date2 As Date
If e.GetValues.ContainsKey("da1") Then
Date1 = e.GetValues("da1") '统计开始日期
Date2 = e.GetValues("da2") '统计结束日期
Else
Return ""
End If
Dim company_name As String = e.Cookies("cookcompanyname") '取出cookies 中的企业名称
Dim Book As New XLS.Book(ProjectPath & "Attachments\report_href1.xls")
Dim sheet As XLS.Sheet = Book.Sheets(0)
Dim fl As String = ExcelPath & "ExcelReport\report_href1.xls"
book.AddD ataTable("采购明细",SQLdataSource,"Select *,b.po_isl * b.po_idj As po_ijr fro m {poOrderMaster} as a left join {poOrderLine} as b on a.po_id=b.po_id") '添加父表 where a.po_date>= #" & Date1 & "# and a.po_date<= #" & Date2 & "#"
book.save( fl )
e.WriteBook(book, "report_href1.xls",False)
此主题相关图片如下:po_report_1.jpg
目的:希望把上面主页中的红颜色变量值填充到->如图(Excel报表)所示的位置。
请问:我在Excel 表中应该如何书写代码?
先谢谢专家!