带有参数形式的时候,直接在报表的单元格中获取数据值,写法如下:
=sql("FRDemo","SELECT * FROM STSCORE where CLASSNO = 'Class1' ",3)
显示效果(班级为Class1的第3列所有值),如下:
若需要显示某个具体值,如:显示 Jonny 的效果(即班级为Class1的第3行第3列的值),写法如下:
=sql("FRDemo","SELECT * FROM STSCORE where CLASSNO = 'Class1' ",3,3)
若参数值为变量如为报表参数或者是某个单元格,则写法如下:
=sql("FRDemo","SELECT * FROM STSCORE where CLASSNO = '"+$class+"' ",3,3)
或
=sql("FRDemo","SELECT * FROM STSCORE where CLASSNO = '"+A1+"' ",3,3)
|