//名称:postmessage 类型:ClientSide 对象:spreadsheetReport 事件:onRenderReport function main(spreadsheetReport) { window.spreadsheetReport = spreadsheetReport; window.addEventListener("message", function(event) { debugger; var data = eval('(' + event.data + ')'); if (data && window.spreadsheetReport.queryId == data.targetReport && "doRefresh" == data.actionType) { if(data.timeParamValue){ //下面设置参数值方法需要客户配置参数名称,也就是第一个参数 window.spreadsheetReport.setParamValue("时间", data.timeParamValue, data.timeParamValue); //如果报表设置了切换参数刷新则将下面的语句注释,如果设置了切换参数不刷新报表则要加上下面这句代码 window.spreadsheetReport.doRefresh(); } } }); }