예제 #1
0
 public int getFixedcols(ReportRequest rrequest) {
   if (rrequest == null) return fixedcols;
   Object objVal =
       rrequest.getAttribute(this.getOwner().getReportBean().getId(), "DYNAMIC_FIXED_COLSCOUNT");
   if (objVal == null) return fixedcols;
   return ((Integer) objVal).intValue();
 }
예제 #2
0
 public String getColLabelWithOrderBy(ColBean cbean, ReportRequest rrequest, String dynlabel) {
   String ordercolumn = cbean.getColumn();
   String label = rrequest.getI18NStringValue(dynlabel);
   label = label == null ? "" : label.trim();
   if (rrequest.getShowtype() != Consts.DISPLAY_ON_PAGE) return label;
   if (ordercolumn == null || ordercolumn.trim().equals("")) return label;
   String[] orderbys =
       (String[]) rrequest.getAttribute(cbean.getReportBean().getId(), "ORDERBYARRAY");
   String arrow = "";
   String order = "asc";
   if (orderbys != null && orderbys.length == 2) {
     if (orderbys[0].equalsIgnoreCase(ordercolumn)) {
       arrow =
           " <img src='"
               + Config.webroot
               + "/webresources/skin/"
               + rrequest.getPageskin()
               + "/images/";
       if (orderbys[1] == null || orderbys[1].equalsIgnoreCase("desc")) {
         arrow = arrow + "desc.gif'>";
         order = "asc";
       } else {
         arrow = arrow + "asc.gif'>";
         order = "desc";
       }
     }
   }
   arrow = Tools.replaceAll(arrow, "//", "/");
   StringBuffer resultBuf = new StringBuffer();
   resultBuf.append("<span onmouseover=\"this.style.cursor='pointer';\" onclick=\"");
   resultBuf
       .append("try{clickorderby(this,'")
       .append(ordercolumn)
       .append("||")
       .append(order)
       .append("');}catch(e){logErrorsAsJsFileLoad(e);}\">");
   resultBuf.append(label).append(arrow);
   resultBuf.append("</span>");
   return resultBuf.toString();
 }
예제 #3
0
 public ColBean getClickOrderByCbean(ReportRequest rrequest, ReportBean rbean) {
   String[] orderbys = (String[]) rrequest.getAttribute(rbean.getId(), "ORDERBYARRAY");
   if (orderbys == null || orderbys.length != 2) return null;
   return rbean.getDbean().getColBeanByColColumn(orderbys[0]);
 }