public String getParentSubtitle(ReportRequest rrequest) {
   return WabacusAssistant.getInstance()
       .getStringValueWithDynPart(rrequest, this.parentSubtitle, this.mDynParentSubtitleParts, "");
 }
 public void setParentSubtitle(String parentSubtitle) {
   Object[] objArr =
       WabacusAssistant.getInstance().parseStringWithDynPart(this.getPageBean(), parentSubtitle);
   this.parentSubtitle = (String) objArr[0];
   this.mDynParentSubtitleParts = (Map<String, String>) objArr[1];
 }
예제 #3
0
 protected Object doGetResultSet(
     SPDataSetValueBean spBean, Object typeObj, StringBuffer systemParamsBuf) {
   log.debug(systemParamsBuf.toString());
   String procedure = spBean.getProcedure();
   if (rbean.getInterceptor() != null) {
     Object obj = rbean.getInterceptor().beforeLoadData(rrequest, rbean, typeObj, procedure);
     if (!(obj instanceof String)) {
       return obj;
     }
     procedure = (String) obj;
   }
   if (Config.show_sql) log.info("Execute sql: " + procedure);
   CallableStatement cstmt = null;
   try {
     cstmt =
         rrequest
             .getConnection(spBean.getOwnerSpProvider().getDatasource())
             .prepareCall(procedure);
     AbsDatabaseType dbtype = rrequest.getDbType(spBean.getOwnerSpProvider().getDatasource());
     VarcharType varcharObj =
         (VarcharType) Config.getInstance().getDataTypeByClass(VarcharType.class);
     int idx = 1;
     if (spBean.getLstStoreProcedureParams() != null
         && spBean.getLstStoreProcedureParams().size() > 0) {
       for (String paramTmp : spBean.getLstStoreProcedureParams()) {
         if (WabacusAssistant.getInstance()
             .isGetRequestContextValue(paramTmp)) { // 从request/session中取值
           varcharObj.setPreparedStatementValue(
               idx,
               WabacusAssistant.getInstance().getRequestContextStringValue(rrequest, paramTmp, ""),
               cstmt,
               dbtype);
         } else if (Tools.isDefineKey("condition", paramTmp)) {
           setConditionValue(
               rrequest,
               spBean,
               cstmt,
               dbtype,
               idx,
               Tools.getRealKeyByDefine("condition", paramTmp),
               varcharObj);
         } else {
           varcharObj.setPreparedStatementValue(idx, paramTmp, cstmt, dbtype);
         }
         idx++;
       }
     }
     if (spBean.getOwnerSpProvider().isUseSystemParams()) {
       if (systemParamsBuf == null) systemParamsBuf = new StringBuffer();
       cstmt.setString(idx++, systemParamsBuf.toString()); // 如果是查询报表数据,将系统参数传入
     }
     if (dbtype instanceof Oracle) {
       cstmt.registerOutParameter(idx, OracleTypes.CURSOR);
     }
     rrequest.addUsedStatement(cstmt);
     cstmt.executeQuery();
     ResultSet rs = null;
     if (dbtype instanceof Oracle) {
       rs = (ResultSet) cstmt.getObject(idx);
     } else {
       rs = cstmt.getResultSet();
     }
     return rs;
   } catch (SQLException e) {
     throw new WabacusRuntimeException(
         "从数据库取报表" + rbean.getPath() + "数据时执行SQL:" + procedure + "失败", e);
   }
 }