两个问题。1.用下面代码生成报表,生成侯保存的路径只能在代码中输入吗?有办法调用保存文件的对话框吗?
Dim Proc As New Process
Dim lst As WinForm.ListBox = e.Form.Controls("ListBox1")
If lst.SelectedValue IsNot Nothing Then
Dim tbx As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim Book As New XLS.Book(ProjectPath & "Attachments\" & lst.SelectedValue )
If tbx.value IsNot Nothing Then
Dim fl As String = ProjectPath & "报表\" & tbx.value & ".xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Book.Build() '生成报表
Book.Save(fl)
Proc.File = fl
Proc.Start()
Else MessageBox.Show("请填写报表名称!","温馨提示:")
End If
Else MessageBox.Show("请选择报表模板!","温馨提示:")
End If
2.生成的报表中求和的时候,想对关联表的某列求和,不知道如何实现,现在的代码是这样的,但是没以偶效果。
[%XMZB.XMFP,Sum(任务人天)]