API参考>客户端>报表脚本API


ReportControl




方法摘要
voidappendTableCol(String tableName)
           向表格最右端追加列
     参数:
        tableName (类型:String)   表格名称
 
voidappendTableRow(String tableName)
           向表格最下方追加行
     参数:
        tableName (类型:String)   表格名称
 
voidfireCustomerEvent(String eventName, Object args)
           触发在报表中的客户自定义事件
     参数:
        eventName (类型:String)   事件名称
        args (类型:Object)   事件参数
 
ObjectgetDataSource(String dsName)
           获取数据源对象
     参数:
        dsName (类型:String)   数据源对象名称
 
ObjectgetExpressionValue(String exp)
           获取表达式的值
     参数:
        exp (类型:String)   表达式

      return: 表达式计算结果
ObjectgetOpenParameter()
           获取ALink的打开参数

      return: 表单打开参数
ObjectgetQueryCondition()
           获取查询条件对象

      return: 查询条件对象
ObjectgetScriptHost(String host)
           获取脚本对象
     参数:
        host (类型:String)   脚本对象的引用表达式

      return: 脚本对象
ObjectgetTableCell(String tableName, int rowIndex, int colIndex)
           获取表格单元格数据
     参数:
        tableName (类型:String)   表格名称
        rowIndex (类型:int)   单元格行号
        colIndex (类型:int)   单元格列号

      return: 单元格数据对象
voidinsertTableColBefor(String tableName, int colIndex)
           向表格指定的列之前插入新列
     参数:
        tableName (类型:String)   表格名称
        colIndex (类型:int)   单元格列号
 
voidinsertTableRowAfter(String tableName, int rowIndex)
           向表格指定的行之后插入新行
     参数:
        tableName (类型:String)   表格名称
        rowIndex (类型:int)   行号
 
voidinsertTableRowBefor(String tableName, int rowIndex)
           向表格指定的行之前插入新行
     参数:
        tableName (类型:String)   表格名称
        rowIndex (类型:int)   行号
 
voidmergeTableCell(String tableName, int x1, int y1, int x2, int y2)
           合并单元格
     参数:
        tableName (类型:String)   表格名称
        x1 (类型:int)   最左单元格列号
        y1 (类型:int)   最上单元格行号
        x2 (类型:int)   最右单元格列号
        y2 (类型:int)   最下单元格行号
 
voidopenALink(String alinkUrl)
           打开ALink链接
     参数:
        alinkUrl (类型:String)   ALink字符串
 
voidsetConditionFormProperty(String fieldName, String propName, Object propValue)
           设置查询条件输入面板中指定控件的属性值。
     参数:
        fieldName (类型:String)   条件面板中的控件名称
        propName (类型:String)   控件的属性名称
        propValue (类型:Object)   控件的属性值
 
voidsetDataSource(String dsName, Object dsValue)
           设置数据源对象。
     参数:
        dsName (类型:String)   数据源对象名称
        dsValue (类型:Object)   数据源对象值
 
voidsetDataSourceField(String dsName, String fieldName, Object fieldValue)
           设置数据源对象中的属性。
     参数:
        dsName (类型:String)   数据源对象名称
        fieldName (类型:String)   数据源对象的字段名称
        fieldValue (类型:Object)   数据源对象的字段值
 
voidsetPivotTable(String tableName, Object xPivots, Object yPivots, String sql, String dataField, Object style, Array recordSet)
           设置数据透视表的生成方式。
     参数:
        tableName (类型:String)   表格名称
        xPivots (类型:Object)   列轴定义,每个轴的定义为:{label:显示名称, field:字段名称}
        yPivots (类型:Object)   行轴定义,每个轴的定义为:{label:显示名称, field:字段名称}
        sql (类型:String)   获取数据的SQL语句,该SQL语句中必须拥有列轴定义和行轴定义中的所有字段
        dataField (类型:String)   统计结果数据的字段名
        style (类型:Object)   表格样式数据:{dataLink:数据链接, dataStyle:数据单元格样式(name1=value1;name2=value2)}
        recordSet (类型:Array)   透视表数据集, 与sql参数互斥
 
voidsetQueryCondition(Object cond)
           设置查询条件对象
     参数:
        cond (类型:Object)   查询条件对象
 
voidsetTableCell(String tableName, int rowIndex, int colIndex, Object cellObj)
           设置表格单元格数据
     参数:
        tableName (类型:String)   表格名称
        rowIndex (类型:int)   单元格行号
        colIndex (类型:int)   单元格列号
        cellObj (类型:Object)   单元格数据,例:{fillColor:"#FF0000"},其中fillColor表示单元格背景色
 
voidsetTableColWidth(String tableName, int colIndex, int width)
           设置表格指定列的宽度
     参数:
        tableName (类型:String)   表格名称
        colIndex (类型:int)   单元格列号
        width (类型:int)   宽度
 
voidsetTableRowHeight(String tableName, int rowIndex, int height)
           设置表格指定行的高度
     参数:
        tableName (类型:String)   表格名称
        rowIndex (类型:int)   行号
        height (类型:int)   高度
 
voidshowContextMenu(Object menuData)
           在当前鼠标位置显示上下文菜单
     参数:
        menuData (类型:Object)   菜单数据定义,类型为对象数组,每一个对象代表一个菜单项,在菜单项中label表示菜单名;action表示菜单执行动作,执行动作中可以触发事件,也可以打开ALink,触发事件的定义为event:{事件名称}[?参数1=xx&参数2=xx...],打开ALink的动作直接用action表示ALink链接即可;在菜单中也可指定iconUrl表示图标所在地址,地址路径为绝对路径。