Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* 
   * Copyright (C) 2010---2013 星星(wuweixing)<349446658@qq.com>
   * 
   * This file is part of Wabacus 
   * 
   * Wabacus is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.wabacus.system.component.application.report.abstractreport;
 
 import java.util.List;
 
 
 public abstract class AbsDetailReportType extends AbsReportType
 {
     public final static String KEY=AbsDetailReportType.class.getName();
     
     public AbsDetailReportType(AbsContainerType parentContainerType,IComponentConfigBean comCfgBean,ReportRequest rrequest)
     {
         super(parentContainerType,comCfgBean,rrequest);
     }
 
     protected String showReportScrollStartTag()
     {
         if(.getShowtype()!=.return "";
         boolean isShowScrollX=.getScrollwidth()!=null&&!.getScrollwidth().trim().equals("");
         boolean isShowScrollY=.getScrollheight()!=null&&!.getScrollheight().trim().equals("");
         return ComponentAssistant.getInstance().showComponentScrollStartPart(,isShowScrollX,isShowScrollY,.getScrollwidth(),
                 .getScrollheight(),.getScrollstyle());
     }
 
     protected String showReportScrollEndTag()
     {
         if(.getShowtype()!=.return "";
         boolean isShowScrollX=.getScrollwidth()!=null&&!.getScrollwidth().trim().equals("");
         boolean isShowScrollY=.getScrollheight()!=null&&!.getScrollheight().trim().equals("");
         return ComponentAssistant.getInstance().showComponentScrollEndPart(isShowScrollX,isShowScrollY);
     }
 
     protected String showColLabel(ColBean cbean,AbsReportDataPojo rowDataObj)
     {
         String label=cbean.getLabel();
         if(label==null||..equals(label)) return "";//<col/>的label没有配置时,不为它显示标题列
         StringBuffer resultBuf=new StringBuffer();
         String labelstyleproperty=this.getColLabelStyleproperty(cbean,rowDataObj);
         ColDisplayData colDisplayData=ColDisplayData.getColDataFromInterceptor(this,cbean,null,-1,labelstyleproperty,label);
         label=colDisplayData.getValue();
         resultBuf.append("<td class='cls-data-th-detail'");
         if(.getShowtype()!=.)
         {
             String dataheaderbgcolor=Config.getInstance().getSkinConfigValue(.getPageskin(),"table.dataheader.bgcolor");
             if(dataheaderbgcolor==nulldataheaderbgcolor="";
             resultBuf.append(" bgcolor='"+dataheaderbgcolor+"'");
         }
         resultBuf.append(" ").append(colDisplayData.getStyleproperty());
         if(label.equals("")) label="&nbsp;";
         resultBuf.append(">"+label+"</td>");
         return resultBuf.toString();
     }
     
     protected  String getDefaultNavigateKey()
     {
         return .;
     }
 
     public int afterReportLoading(ReportBean reportbean,List<XmlElementBeanlstEleReportBeans)
     {
         super.afterReportLoading(reportbean,lstEleReportBeans);
         reportbean.setCellresize(0);
         return 1;
     }
    public int afterColLoading(ColBean colbean,List<XmlElementBeanlstEleColBeans)
    {
        super.afterColLoading(colbean,lstEleColBeans);
        if(colbean.isSequenceCol())
        {
            throw new WabacusConfigLoadingException("报表"+colbean.getReportBean().getPath()+"为数据细览报表,不允许<col/>标签的column属性配置为自动增长列");
        }
        if(colbean.isRowSelectCol())
        {
            throw new WabacusConfigLoadingException("报表"+colbean.getReportBean().getPath()+"为数据细览报表,不允许<col/>标签的column属性配置为行选中列");
        }
        if(colbean.isRoworderCol())
        {
            throw new WabacusConfigLoadingException("报表"+colbean.getReportBean().getPath()+"为数据细览报表,不允许<col/>标签的column属性配置为行排序列");
        }
        return 1;
    }
    public int doPostLoad(ReportBean reportbean)
    {
        super.doPostLoad(reportbean);
        constructSqlForDetailType(reportbean.getSbean());
        DisplayBean dbean=reportbean.getDbean();
        List<ColBeanlstColBeans=dbean.getLstCols();
        {
            throw new WabacusConfigLoadingException("加载报表"+reportbean.getPath()+"失败,细览报表不支持"
                    +.+"和"+.+"两种边框类型");
        }
        if(lstColBeans!=null&&lstColBeans.size()>0)
        {
            for(ColBean cbean:lstColBeans)
            {
                if(..equals(cbean.getDisplaytype())) continue;
                String borderstyle=cbean.getBorderStylePropertyOnColBean();
                if(borderstyle!=null&&!borderstyle.trim().equals(""))
                {
                    cbean.setValuestyleproperty(Tools.mergeHtmlTagPropertyString(cbean.getValuestyleproperty(null,true),"style=\""+borderstyle+"\"",1),true);
                    cbean.setLabelstyleproperty(Tools.mergeHtmlTagPropertyString(cbean.getLabelstyleproperty(null,true),"style=\""+borderstyle+"\"",1),true);
                }
            }
        }
        if(dbean.getColselect()==nulldbean.setColselect(false);
        
        boolean isShowScrollX=reportbean.getScrollwidth()!=null&&!reportbean.getScrollwidth().trim().equals("");
        boolean isShowScrollY=reportbean.getScrollheight()!=null&&!reportbean.getScrollheight().trim().equals("");
        ComponentAssistant.getInstance().doPostLoadForComponentScroll(reportbean,isShowScrollX,isShowScrollY,reportbean.getScrollwidth(),
                reportbean.getScrollheight(),reportbean.getScrollstyle());
        return 1;
    }
    private void constructSqlForDetailType(SqlBean sqlbean)
    {
        if(sqlbean==null||sqlbean.getLstDatasetBeans()==nullreturn;
        for(ReportDataSetBean dsbeanTmp:sqlbean.getLstDatasetBeans())
        {
            for(ReportDataSetValueBean dsvbeanTmp:dsbeanTmp.getLstValueBeans())
            {
                String value=dsvbeanTmp.getValue();
                if(value==null||value.trim().equals("")||dsvbeanTmp.isStoreProcedure()||dsvbeanTmp.getCustomizeDatasetObj()!=nullcontinue;
                dsvbeanTmp.doPostLoadSql(false);
                if(!dsvbeanTmp.isDependentDataSet()) dsvbeanTmp.buildPageSplitSql();
            }
        }
    }
    
    public String getReportFamily()
    {
        return .;
    }
    
    public abstract String showColData(ColBean cbean,boolean showpart,boolean showinputbox,String dynstyleproperty);
New to GrepCode? Check out our FAQ X