利用用户归档做了一个报表系统,在报表布局中插入一ODBC数据表,有23列,点击"显示列的标题"打钩,由于用户归档中变量名称是字母组成的如果显示在报表中不直观,于是用利用SQL语言的AS 更改了下列标题,命令如下:
sSql_1="Select id, riqi AS 日期,shijian AS 时间,pici AS 批次,guigexinghao AS 规格型号,"
sSql_1=sSql_1 &" wuxinghao AS 物性号,zhuliao_SP AS 主料设定值,zhuliao_actual AS 主料实配值,"
sSql_1=sSql_1 &"ZL_Disch_qianxianshi AS 主料排料前值,ZL_disch_houxianshi AS 主料排料后值,"
sSql_1=sSql_1 &"YTA_SP AS 液体A设定值,YTB_SP AS 液体B设定值,YTC_SP AS 液体C设定值,"
sSql_1=sSql_1 &"YTA_actual AS 液体A实配值,YTB_actual AS 液体B实配值,YTC_actual AS 液体C实配值,"
sSql_1=sSql_1 &"YTA_PLqianxiansh AS 液体A排料前值,YTB_PLqianxiansh AS 液体B排料前值,YTC_PLqianxiansh AS 液体C排料前值,"
sSql_1=sSql_1 &"YTA_disch_houxiansh AS 液体A排料后值,YTB_disch_houxiansh AS 液体B排料后值,YTC_disch_houxiansh AS 液体C排料后值,"
sSql_1=sSql_1 &"banci AS 班次 "
sSql_1=sSql_1 &"from UA#Formula WHERE riqi between '"&DateFrom&"'and '"&DateTo&"'"
MsgBox(sSql_1)
但是这样的话打印预览出不来,为什么??
如果去掉其中任何五列值就出现我AS后的标题内容,哪位知道为什么这样呢?
在报表布局中通过ODBC属性测试SQL语句 都正常的!
最佳答案
按理说不应该有条数限制呀,实在不行就放两页试试,呵呵
提问者对于答案的评价:
OK
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc267060.html