Java 类net.sf.jasperreports.engine.type.WhenNoDataTypeEnum 实例源码

项目:jasperreports    文件:JRBaseReport.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    styleResolver = StyleResolver.getInstance();

    if (detail != null)
    {
        detailSection = new JRBaseSection(detail);
        detail = null;
    }

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        whenNoDataTypeValue = WhenNoDataTypeEnum.getByValue(whenNoDataType);
        printOrderValue = PrintOrderEnum.getByValue(printOrder);
        orientationValue = OrientationEnum.getByValue(orientation);
    }
}
项目:jasperreports    文件:JRBaseFiller.java   
/**
 *
 */
protected WhenNoDataTypeEnum getWhenNoDataType()
{
    WhenNoDataTypeEnum result = whenNoDataType;

    if (result == null)
    {
        result = 
            WhenNoDataTypeEnum.getByName(
                propertiesUtil.getProperty(mainDataset, JRReport.CONFIG_PROPERTY_WHEN_NO_DATA_TYPE)
                );
    }

    return result;
}
项目:com.opendoorlogistics    文件:ReportBuilderUtils.java   
static JasperDesign createEmpty(String tablename, int pageWidth, int pageHeight, boolean margins) {
    JasperDesign ret = new JasperDesign();
    ret.setName(Strings.removeExportIllegalChars(AppConstants.ORG_NAME + " - " + tablename));
    ret.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
    ret.setWhenResourceMissingType(WhenResourceMissingTypeEnum.EMPTY);
    ret.setOrientation(OrientationEnum.LANDSCAPE);
    ret.setPageWidth(pageWidth);
    ret.setPageHeight(pageHeight);

    if (!margins) {
        ret.setLeftMargin(0);
        ret.setRightMargin(0);
        ret.setTopMargin(0);
        ret.setBottomMargin(0);
    }

    ret.setColumnWidth(Math.min(getAvailableWidth(ret), ret.getColumnWidth()));

    return ret;
}
项目:jasperreports    文件:JRBaseReport.java   
@Override
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataTypeValue)
{
    Object old = this.whenNoDataTypeValue;
    this.whenNoDataTypeValue = whenNoDataTypeValue;
    getEventSupport().firePropertyChange(PROPERTY_WHEN_NO_DATA_TYPE, old, whenNoDataTypeValue);
}
项目:jasperreports    文件:TableReport.java   
@Override
public WhenNoDataTypeEnum getWhenNoDataTypeValue()
{
    WhenNoDataTypeTableEnum whenNoDataType = table.getWhenNoDataType(); 
    if (whenNoDataType == null)
    {
        whenNoDataType = 
            WhenNoDataTypeTableEnum.getByName(
                propertiesUtil.getProperty(
                    fillContext.getFillDataset(),
                    TableComponent.CONFIG_PROPERTY_WHEN_NO_DATA_TYPE
                    )
                );
    }

    switch (whenNoDataType)
    {
        case ALL_SECTIONS_NO_DETAIL :
        {
            return WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL;
        }
        case BLANK :
        default :
        {
            return WhenNoDataTypeEnum.NO_PAGES;
        }
    }
}
项目:ireport-fork    文件:WhenNoDataTypeProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL, I18n.getString("WhenNoDataTypeProperty.Property.All")));
    tags.add(new Tag(WhenNoDataTypeEnum.BLANK_PAGE, I18n.getString("WhenNoDataTypeProperty.Property.Blank")));
    tags.add(new Tag(WhenNoDataTypeEnum.NO_DATA_SECTION, I18n.getString("WhenNoDataTypeProperty.Property.Section")));
    tags.add(new Tag(WhenNoDataTypeEnum.NO_PAGES, I18n.getString("WhenNoDataTypeProperty.Property.Pages")));
    return tags;
}
项目:nextreports-server    文件:JasperReportsUtil.java   
public static JasperReport getJasper(String file) throws JRException {
         // Jasper 5.1.0+
        JasperReport jr = (JasperReport) JRLoader.loadObjectFromFile(file);
        // default is WHEN_NO_DATA_TYPE_BLANK_PAGE
        // we want to show something even no data found
        jr.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
        return jr;

//      JasperReport jr = (JasperReport) JRLoader.loadObject(file);
//        // default is WHEN_NO_DATA_TYPE_BLANK_PAGE
//        // we want to show something even no data found
//        jr.setWhenNoDataType(JasperReport.WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL);
//        return jr;
    }
项目:jasperreports    文件:JRBaseReport.java   
@Override
public WhenNoDataTypeEnum getWhenNoDataTypeValue()
{
    return whenNoDataTypeValue;
}
项目:jasperreports    文件:TableReport.java   
@Override
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataType)
{
    throw new UnsupportedOperationException();
}
项目:ireport-fork    文件:WhenNoDataTypeProperty.java   
@SuppressWarnings("unchecked")
public WhenNoDataTypeProperty(JasperDesign jasperDesign)
{
    super(WhenNoDataTypeEnum.class, jasperDesign);
    this.jasperDesign = jasperDesign;
}
项目:ireport-fork    文件:WhenNoDataTypeProperty.java   
@Override
public Object getDefaultValue()
{
    return WhenNoDataTypeEnum.NO_PAGES;
}
项目:ireport-fork    文件:WhenNoDataTypeProperty.java   
@Override
public void setPropertyValue(Object type)
{
    jasperDesign.setWhenNoDataType((WhenNoDataTypeEnum)type);
}
项目:VaadinUtils    文件:JasperManager.java   
/**
 * replaces the header, footer, nodata band and dynamically adds user
 * friendly report parameter display to the report.
 *
 * @param designFile
 * @param template
 * @throws JRException
 */
private void replaceHeader(JasperDesign designFile, JasperDesign template) throws JRException
{
    JRBand title = template.getTitle();
    JRDesignBand newTitle = new JRDesignBand();

    int margin = 50;
    designFile.setLeftMargin(margin);
    designFile.setRightMargin(margin);
    designFile.setTopMargin(margin);
    designFile.setBottomMargin(margin);

    double pageWidth = designFile.getPageWidth() + (margin * 2);

    double ratio = 0.75; // landscape
    if (designFile.getPageHeight() / pageWidth >= 1)
    {
        ratio = 1.5; // portrait
    }
    int pageHeight = (int) (pageWidth * ratio);
    designFile.setPageWidth((int) pageWidth);
    designFile.setPageHeight(pageHeight);

    int maxY = determineSizeOfTemplateBandAndReplaceTitlePlaceHolder(designFile, title, newTitle, margin);

    maxY += 2;

    mergeExistingTitleWithTemplateTitle(designFile, newTitle, maxY);

    JRBand footer = replaceFooterWithTemplateFooter(designFile, template, margin);

    designFile.setPageFooter(footer);

    JRDesignBand noDataBand = new JRDesignBand();
    int noDataHeight = determineSizeOfTemplateBandAndReplaceTitlePlaceHolder(designFile, template.getNoData(),
            noDataBand, margin);
    designFile.setNoData(noDataBand);
    noDataBand.setHeight(noDataHeight);
    designFile.setWhenNoDataType(WhenNoDataTypeEnum.NO_DATA_SECTION);

}
项目:jasperreports    文件:JRReport.java   
/**
 * Specifies the report behavior in case of empty datasources.
 */
public WhenNoDataTypeEnum getWhenNoDataTypeValue();
项目:jasperreports    文件:JRReport.java   
/**
 * Sets the report behavior in case of empty datasources.
 */
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataType);
项目:jasperreports-scala    文件:JRReport.java   
/**
 * Specifies the report behavior in case of empty datasources.
 */
public WhenNoDataTypeEnum getWhenNoDataTypeValue();
项目:jasperreports-scala    文件:JRReport.java   
/**
 * Sets the report behavior in case of empty datasources.
 */
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataType);