导出代码如下:
Dim t As Table=Tables("系统计划_t")
t.fill("select 客户编号,客户名称,币种,round(sum(总金额),2) as 总金额,isnull(sum(已收金额),0) as 已收金额,isnull(sum(已开piao金额),0) as 已开piao金额 ,round(sum(总金额)-isnull(sum(已收金额),0),2) as 应收金额 from{销售报价单} where 总金额>isnull(已收金额,0) and 审核=1 and 合同=1 group by 客户编号,客户名称,币种","A5 ERP",True)
If T.ROWS.COUNT>0 Then
t.Cols("总金额").grandtotal=True
t.Cols("已开piao金额").grandtotal=True
t.Cols("应收金额").grandtotal=True
t.Cols("已收金额").grandtotal=True
t.grandtotal=True
End If
If FileSys.FileExists(ProjectPath & "\mail\应收帐款.xls") Then '如果指定的文件存在
FileSys.DeleteFile(ProjectPath & "\mail\应收帐款.xls",2,2) '则彻底删除之
End If
Dim ex As New Exporter
ex.SourceTableName ="系统计划_t"
ex.FilePath =ProjectPath & "\mail\应收帐款.xls"
ex.Format = "Excel"
ex.Export()
现在有个问题 导出的格式并不是合计模式,如何实现系统菜单中的导出功能 即:在系统中做了什么统计导出后格式与其一致?