以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 报表不显示数据 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=161643) |
-- 作者:lsjt_1979 -- 发布时间:2021/3/25 11:31:00 -- 报表不显示数据 老师好,我用语句测试报表,但是不能显示数据 直接执行语句显示的数据如下: Di m sq lstr a s S tring="s elect * f rom (s elect distinct [订单编号],[车队] a s 往来单位,\'拖车费\' a s 收费科目,[拖车费] a s 单价, c ount(*) a s 数量,sum(拖车费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\'and [拖车费]>0 g roup by [订单编号], [车队],[拖车费]) a s a " & _ " u nion s elect * f rom (s elect distinct [订单编号],[承运方] a s 往来单位,\'铁路运费\' a s 收费科目,[铁路运费] a s 单价, c ount(*) a s 数量,sum(铁路运费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [铁路运费]>0 g roup by [订单编号], [承运方],[铁路运费]) a s b " & _ " u nion s elect * f rom (s elect distinct [订单编号],[报关行] a s 往来单位,\'报关费\' a s 收费科目,[报关费] a s 单价, c ount(*) a s 数量,sum(报关费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [报关费]>0 g roup by [订单编号], [报关行],[报关费]) a s c " & _ " u nion s elect * f rom (s elect distinct [订单编号],[装箱货场] a s 往来单位,\'装箱费\' a s 收费科目,[装箱费] a s 单价, c ount(*) a s 数量,sum(装箱费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [装箱费]>0 g roup by [订单编号], [装箱货场],[装箱费]) a s d " & _ " u nion s elect * f rom (s elect distinct [订单编号],[加固队] a s 往来单位,\'加固费\' a s 收费科目,[加固费] a s 单价, c ount(*) a s 数量,sum(加固费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [加固费]>0 g roup by [订单编号], [加固队],[加固费]) a s e " & _ " u nion s elect * f rom (s elect distinct [订单编号],[代码公司] a s 往来单位,\'境外运费USD\' a s 收费科目,[境外运费USD] a s 单价, c ount(*) a s 数量,sum(境外运费USD) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [境外运费USD]>0 g roup by [订单编号], [代码公司],[境外运费USD]) a s f" & _ " u nion s elect * f rom (s elect distinct [订单编号],[单证公司] a s 往来单位,\'单证\' a s 收费科目,[单证公司] a s 单价, c ount(*) a s 数量,sum(单证费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [单证费]>0 g roup by [订单编号], [单证公司],[单证费]) a s g" & _ " u nion s elect * f rom (s elect distinct [订单编号],[口岸代理] a s 往来单位,\'查验费\' a s 收费科目,[查验费] a s 单价, c ount(*) a s 数量,sum(查验费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [查验费]>0 g roup by [订单编号], [口岸代理],[查验费]) a s h" & _ " u nion s elect * f rom (s elect distinct [订单编号],[口岸代理] a s 往来单位,\'滞留费\' a s 收费科目,[滞留费] a s 单价, c ount(*) a s 数量,sum(滞留费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [滞留费]>0 g roup by [订单编号], [口岸代理],[滞留费]) a s i" & _ " u nion s elect * f rom (s elect distinct [订单编号],[口岸代理] a s 往来单位,\'放射放行费\' a s 收费科目,[放射放行费] a s 单价, c ount(*) a s 数量,sum(放射放行费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [放射放行费]>0 g roup by [订单编号], [口岸代理],[放射放行费]) a s j" & _ " u nion s elect * f rom (s elect distinct [订单编号],[口岸代理] a s 往来单位,\'退运运费\' a s 收费科目,[退运运费] a s 单价, c ount(*) a s 数量,sum(退运运费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [退运运费]>0 g roup by [订单编号], [口岸代理],[退运运费]) a s k" & _ " u nion s elect * f rom (s elect distinct [订单编号],[口岸代理] a s 往来单位,\'落地交付费\' a s 收费科目,[落地交付费] a s 单价, c ount(*) a s 数量,sum(落地交付费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [落地交付费]>0 g roup by [订单编号], [口岸代理],[落地交付费]) a s l" & _ " u nion s elect * f rom (s elect distinct [订单编号],[其他单位] a s 往来单位,\'RMB杂费\' a s 收费科目,[RMB杂费] a s 单价, c ount(*) a s 数量,sum(RMB杂费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [RMB杂费]>0 g roup by [订单编号], [其他单位],[RMB杂费]) a s m" & _ " u nion s elect * f rom (s elect distinct [订单编号],[其他单位1] a s 往来单位,\'美元杂费\' a s 收费科目,[美元杂费] a s 单价, c ount(*) a s 数量,sum(美元杂费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [美元杂费]>0 g roup by [订单编号], [其他单位1],[美元杂费]) a s n" & _ " u nion s elect * f rom (s elect distinct [订单编号],[卖箱公司] a s 往来单位,\'买箱费\' a s 收费科目,[买箱费] a s 单价, c ount(*) a s 数量,sum(买箱费) a s 金额 f rom {销售应付} w here [订单编号]=\'TW-202012-001\' and [买箱费]>0 g roup by [订单编号], [卖箱公司],[买箱费]) a s o" Di m Bo ok a s Ne w XL S.Book(ProjectPath & "Attachments\\单票收支模板.xls") Di m fl a s St ring = Proj ectPath & "Reports\\单票收支模板.xls" \'bo ok.Ad d Da taTable("销售明细","天津拓帷",sqlstr) \'添加父表 bo ok.Ad d D ataTable("销售应付","天津拓帷",sqlstr) \'添加子表 \'bo ok.Ad d Relati on("销售明细","订单编号","销售应付","订单编号") \'建立关联 Boo k. Bu ild() \'生成细节区 Boo k. S ave(fl) \'保存工作簿 Di m Pr oc a s Ne w P rocess \'打开工作簿 Pro c.File = fl Pro c.Start() |
-- 作者:有点蓝 -- 发布时间:2021/3/25 11:38:00 -- 模板发上来看看
|
-- 作者:lsjt_1979 -- 发布时间:2021/3/25 11:47:00 -- 此主题相关图片如下:1616643976(1).jpg |
-- 作者:有点蓝 -- 发布时间:2021/3/25 11:49:00 -- 模板本身就是空的,根本没有数据引用:http://www.foxtable.com/webhelp/topics/0198.htm 另外代码只使用了一个表,模板却是有2个表,根本对应不上
[此贴子已经被作者于2021/3/25 11:49:59编辑过]
|
-- 作者:lsjt_1979 -- 发布时间:2021/3/25 15:54:00 -- 单独测试这一部分可以体现整合数据,但是现在有个问题,我是需要美金和人民币的整合费用是分开的,美金的整合费用在左面,人民币的在右面,我现在体现出来的都是在人民币里体现了,有没有解决办法 这是我的表结构,需要把每一票单子的各项费用整合后以其他名称体现出来
|
-- 作者:有点蓝 -- 发布时间:2021/3/25 16:11:00 -- 生成报表的表格也需要分为左右2个部分,比如左边列名为"美金_往来单位",右边列名为"人民币_往来单位"。 过于复杂的格式建议还是使用专业报表处理
|