public FillPartPrintOutput(BaseReportFiller filler) { parts = new TreeMap<Integer, PrintPart>(); pages = new ArrayList<JRPrintPage>(); delayedActions = new DelayedFillActions(filler); delayedActions.createDelayedEvaluationTime(JREvaluationTime.EVALUATION_TIME_MASTER); if (log.isDebugEnabled()) { log.debug(this + " created delayed actions " + delayedActions.getId()); } if (filler.getFillContext().isCollectingBookmarks()) { bookmarkHelper = new BookmarkHelper(true); } styles = new LinkedHashMap<String, JRStyle>(); origins = new LinkedHashSet<JROrigin>(); }
@Override public Object createObject(Attributes atts) { return new JROrigin( atts.getValue(JRXmlConstants.ATTRIBUTE_report), atts.getValue(JRXmlConstants.ATTRIBUTE_group), BandTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_band)) ); }
protected void setSectionOrigin(JRSection section, BandTypeEnum type) { if (section instanceof JRDesignSection) { JROrigin origin = new JROrigin(null, getName(), type); ((JRDesignSection) section).setOrigin(origin); } }
protected void setBandOrigin(JRBand band, BandTypeEnum type) { if (band instanceof JRDesignBand) { JROrigin origin = new JROrigin(null, getName(), type); ((JRDesignBand) band).setOrigin(origin); } }
/** * */ protected void setOrigin(JROrigin origin) { this.origin = origin; if (bandsList != null && bandsList.size() > 0) { for (Iterator<JRBand> it = bandsList.iterator(); it.hasNext();) { JRDesignBand band = (JRDesignBand)it.next(); band.setOrigin(origin); } } }
@SuppressWarnings("deprecation") public JasperDesign(JasperReportsContext context) { setMainDataset(new JRDesignDataset(context, true)); detailSection = new JRDesignSection(new JROrigin(BandTypeEnum.DETAIL)); }
protected void setBandOrigin(JRBand band, BandTypeEnum type) { if (band instanceof JRDesignBand) { JROrigin origin = new JROrigin(type); ((JRDesignBand) band).setOrigin(origin); } }
protected void setSectionOrigin(JRSection section, BandTypeEnum type) { if (section instanceof JRDesignSection) { JROrigin origin = new JROrigin(type); ((JRDesignSection) section).setOrigin(origin); } }
/** * @throws IOException */ protected void exportOrigin(JROrigin origin) throws IOException { xmlWriter.startElement(JRXmlConstants.ELEMENT_origin); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_report, origin.getReportName()); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_group, origin.getGroupName()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_band, origin.getBandTypeValue()); xmlWriter.closeElement(); }
@Override public boolean isToExport(JRPrintElement element) { JROrigin origin = element.getOrigin(); Boolean keepFirst = null; if (origin != null) { keepFirst = matchedOrigins.get(origin); if (keepFirst == null) { for (JROrigin originToExclude : originsToExclude.keySet()) { if (match(originToExclude, origin)) { keepFirst = originsToExclude.get(originToExclude); matchedOrigins.put(origin, keepFirst); break; } } } } boolean originMatched = keepFirst != null; return !originMatched || (keepFirst.booleanValue() && isFirst(element)); }
public boolean match(JROrigin originToExclude, JROrigin origin) { String groupName1 = originToExclude.getGroupName(); String reportName1 = originToExclude.getReportName(); String groupName2 = origin.getGroupName(); String reportName2 = origin.getReportName(); return ( originToExclude.getBandTypeValue() == origin.getBandTypeValue() && (("*".equals(groupName1) && groupName2 != null) || (groupName1 == null ? groupName2 == null : groupName2 != null && groupName1.equals(groupName2))) && (("*".equals(reportName1) && reportName2 != null) || (reportName1 == null ? reportName2 == null : reportName2 != null && reportName1.equals(reportName2))) ); }
private static JROriginExporterFilter addOriginsToFilter( JasperReportsContext jasperReportsContext, JROriginExporterFilter filter, JRPropertiesMap propertiesMap, String originFilterPrefix, boolean keepFirst ) { JRPropertiesUtil propUtil = JRPropertiesUtil.getInstance(jasperReportsContext); List<PropertySuffix> properties = propUtil.getProperties(originFilterPrefix + BAND_PREFIX); properties.addAll(JRPropertiesUtil.getProperties(propertiesMap, originFilterPrefix + BAND_PREFIX)); if (!properties.isEmpty()) { filter = (filter == null ? new JROriginExporterFilter(): filter); for(Iterator<PropertySuffix> it = properties.iterator(); it.hasNext();) { PropertySuffix propertySuffix = it.next(); String suffix = propertySuffix.getSuffix(); String propValue = propUtil.getProperty(propertiesMap, propertySuffix.getKey()); BandTypeEnum bandType = BandTypeEnum.getByName(propValue == null ? null : propValue.trim()); if (bandType != null) { filter.addOrigin( new JROrigin( propUtil.getProperty(propertiesMap, originFilterPrefix + REPORT_PREFIX + suffix), propUtil.getProperty(propertiesMap, originFilterPrefix + GROUP_PREFIX + suffix), bandType ), keepFirst ); } } } return filter; }
/** * */ protected void setOrigin(JROrigin origin) { this.origin = origin; if (bands.length > 0) { for (int i = 0; i < bands.length; i++) { bands[i].setOrigin(origin); } } this.filler.getJasperPrint().addOrigin(origin);//FIXMESECTION detail origin appears even if empty }
/** * */ protected JRTemplateGraphicElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRGraphicElement graphicElement) { super(origin, defaultStyleProvider); setGraphicElement(graphicElement); }
/** * */ protected JRTemplateLine(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRLine line) { super(origin, defaultStyleProvider); setLine(line); }
/** * */ protected void setOrigin(JROrigin origin) { if (log.isDebugEnabled()) { log.debug("Origin " + origin + " for band " + getId()); } this.origin = origin; this.filler.getJasperPrint().addOrigin(origin); }
/** * */ protected JRTemplateElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider) { this.origin = origin; this.defaultStyleProvider = defaultStyleProvider; id = createId(); }
/** * */ protected JRTemplateEllipse(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JREllipse ellipse) { super(origin, defaultStyleProvider); setEllipse(ellipse); }
/** * */ protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRRectangle rectangle) { super(origin, defaultStyleProvider); setRectangle(rectangle); }
/** * */ protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRSubreport subreport) { super(origin, defaultStyleProvider); setSubreport(subreport); }
/** * */ protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText) { super(origin, defaultStyleProvider); setStaticText(staticText); }
/** * */ protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField) { super(origin, defaultStyleProvider); setTextField(textField); }
/** * Creates a template text. * * @param origin the origin of the elements that will use this template * @param defaultStyleProvider the default style provider to use for * this template */ public JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider) { super(origin, defaultStyleProvider); lineBox = new JRBaseLineBox(this); paragraph = new JRBaseParagraph(this); }
protected JRTemplateGenericElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRGenericElement element) { super(origin, defaultStyleProvider); setElement(element); setGenericType(element.getGenericType()); }
/** * Creates a generic print element template. * * @param origin the origin of the elements that will use the template * @param defaultStyleProvider the style provider to be used for the elements * @param genericType the type of the generic elements */ public JRTemplateGenericElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRGenericElementType genericType) { super(origin, defaultStyleProvider); setGenericType(genericType); }
/** * Creates a generic print element template. * * @param origin the origin of the elements that will use the template * @param defaultStyleProvider the style provider to be used for the elements * @param element an element to copy basic elements from * @param genericType the type of the generic elements */ public JRTemplateGenericElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRElement element, JRGenericElementType genericType) { super(origin, defaultStyleProvider); setElement(element); setGenericType(genericType); }
/** * Creates a template frame for a crosstab cell. * * @param cell the cell */ public JRTemplateFrame(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRFillCellContents cell) { super(origin, defaultStyleProvider); //FIXME properties? parentStyle = cell.getStyle(); setBackcolor(cell.getBackcolor()); setMode(cell.getModeValue()); copyBox(cell.getLineBox()); }
/** * Creates a template frame for a frame. * * @param frame the frame */ public JRTemplateFrame(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRFillFrame frame) { super(origin, defaultStyleProvider); setElement(frame); copyBox(frame.getLineBox()); }
private JRFillBand createFillBand(JRBand reportBand, String reportName, BandTypeEnum bandType) { JRFillBand fillBand = factory.getBand(reportBand); if (fillBand != missingFillBand) { JROrigin origin = new JROrigin(reportName, bandType); fillBand.setOrigin(origin); } return fillBand; }
/** * */ protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRImage image) { super(origin, defaultStyleProvider); setImage(image); }
/** * */ protected JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRChart chart) { super(origin, defaultStyleProvider); setChart(chart); }
/** * Creates a template image. * * @param origin the origin of the elements that will use this template * @param defaultStyleProvider the default style provider to use for * this template */ public JRTemplateImage(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider) { super(origin, defaultStyleProvider); this.lineBox = new JRBaseLineBox(this); this.linePen = new JRBasePen(this); }
@Override public void addOrigins(Collection<JROrigin> origins) { for (JROrigin origin : origins) { jasperPrint.addOrigin(origin); } }
protected JROrigin getElementOrigin() { JROrigin elementOrigin = null; if (originProvider != null) { elementOrigin = originProvider.getOrigin(); } return elementOrigin; }
protected JRSection wrapBand(JRBand band, BandTypeEnum bandType) { if (band == null) { return null; } JROrigin origin = new JROrigin(null, getName(), bandType); JRDesignSection section = new JRDesignSection(origin); section.addBand(band); return section; }
public static String nameOf(JROrigin origin) { if (origin != null) { switch (origin.getBandTypeValue()) { case BACKGROUND: return I18n.getString("band.name.background"); case TITLE: return I18n.getString("band.name.title"); case PAGE_HEADER: return I18n.getString("band.name.pageHeader"); case COLUMN_HEADER: return I18n.getString("band.name.columnHeader"); case DETAIL: return I18n.getString("band.name.detail"); case COLUMN_FOOTER: return I18n.getString("band.name.columnFooter"); case PAGE_FOOTER: return I18n.getString("band.name.pageFooter"); case LAST_PAGE_FOOTER: return I18n.getString("band.name.lastPageFooter"); case SUMMARY: return I18n.getString("band.name.summary"); case NO_DATA: return I18n.getString("band.name.noData"); case GROUP_HEADER: { // Find the section number return I18n.getString("band.name.GroupHeader", origin.getGroupName()); } case GROUP_FOOTER: { return I18n.getString("band.name.GroupFooter", origin.getGroupName()); } } } return I18n.getString("ModelUtils.Title.unknow"); }
@Override public JROrigin getOrigin() { return origin; }
/** * */ public void setOrigin(JROrigin origin) { this.origin = origin; }
@Override public void addOrigins(Collection<JROrigin> origins) { this.origins.addAll(origins); }
public Collection<JROrigin> getOrigins() { return origins; }