在服务端使用下列代码生成excel报表 发现内容是空白的使用writebook又是正常的.
我的目的是想把excel报表转成图片发给客户端,不发送excel或者pdf文件,
Dim wb As New weui
Dim e As RequestEventArgs = args(0)
Dim lj As String
If e.GetValues("bjf")<>"" Then
lj=ProjectPath & "Attachments\" & e.GetValues("bjf") & "报价单.xlsx"
If FileSys.FileExists(lj)=False Then
With wb.AddMsgPage("","msgpage","操作失败","不能使用非约定报价单位!")
.AddButton("btn1","返回","index.htm" )
.Icon="warn"
End With
e.WriteString(wb.Build)
Return Nothing
End If
Dim Book As New XLS.Book(lj)
book.AddDataTable("报价单","cderp","Sel ect * from {报价单} where 报价单号= '" & e.GetValues("id") & "'")
book.AddDataTable("报价明细","cderp","Se lect * from {报价明细} where 报价单号= '" & e.GetValues("id") & "'")
book.AddRelation("报价单","报价单号","报价明细","报价单号")
'e.WriteBookAsHTML(Book)
' e.WriteBookAsPDF(Book)
Dim fl As String=ProjectPath & "web\temp\" & rand.NextString(12) & ".xlsx"
Book.Build()
Book.Save(fl)
e.WriteFile(fl)
End If