public void exportElement( JRXmlExporterContext exporterContext, JRGenericPrintElement element ) { JRXml4SwfExporter exporter = (JRXml4SwfExporter)exporterContext.getExporterRef(); JRPrintText text = getTextElementReplacement(exporterContext, element); try { exporter.exportText(text); } catch (IOException e) { throw new JRRuntimeException(e); } }
@Override public void exportElement( JRXmlExporterContext exporterContext, JRGenericPrintElement element ) { try { JRXmlExporter exporter = (JRXmlExporter)exporterContext.getExporterRef(); exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void exportElement(JRXmlExporterContext exporterContext, JRGenericPrintElement element) { try { JRXmlExporter exporter = (JRXmlExporter) exporterContext.getExporter(); exporter.exportImage(getImage(exporterContext.getJasperReportsContext(), element)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Exporta bullet para alternativa de questao * @param exporterContext * @param element * @param eqaKey */ protected void exportAlternativeBullet(JRXmlExporterContext exporterContext, JRGenericPrintElement element, Object eqaKey ) { int x = element.getX() + exporterContext.getOffsetX(); int y = element.getY() - exporterContext.getOffsetY(); int x2 = x + element.getWidth(); int y2 = element.getY() - exporterContext.getOffsetY() - element.getHeight(); int w = x2 - x; int h = y - y2; JRXmlExporter xmlExporter = (JRXmlExporter) exporterContext.getExporter(); JRDefaultStyleProvider defaultStyleProvider = element.getDefaultStyleProvider(); if (log.isDebugEnabled()) { log.debug("id=" + eqaKey + " x=" + x + ",y=" + y + ",w=" + w + ",h=" + h + ""); } JRBasePrintEllipse ellipse = new JRBasePrintEllipse(defaultStyleProvider); //darcio 25/06/2013 nao sera mais necessario marcar a p�gina por aqui //Object actualPage = element.getParameterValue("actualPage"); //ellipse.setKey("" + eqaKey + "-" + actualPage); ellipse.setKey("" + eqaKey); ellipse.setX(x); ellipse.setY(y); ellipse.setHeight(h); ellipse.setWidth(w); JRPrintText text = new JRBasePrintText(defaultStyleProvider); text.setForecolor(Color.RED); text.setX(x + 20); text.setY(y + 3); text.setHeight(10); text.setWidth(200); text.setText(eqaKey + " x=" + x + " y=" + y); try { xmlExporter.exportElement(ellipse); xmlExporter.exportText(text); } catch (Exception e) { throw new RuntimeException("Erro ao tentar exportar elemento", e); } }
/** * Exporta bullet para alternativa de questao * @param exporterContext * @param element * @param eqaKey */ protected void exportAlternativeBullet(JRXmlExporterContext exporterContext, JRGenericPrintElement element, Object eqaKey ) { int x = element.getX() + exporterContext.getOffsetX(); int y = element.getY() - exporterContext.getOffsetY(); int x2 = x + element.getWidth(); int y2 = element.getY() - exporterContext.getOffsetY() - element.getHeight(); int w = x2 - x; int h = y - y2; JRXmlExporter xmlExporter = (JRXmlExporter) exporterContext.getExporter(); JRDefaultStyleProvider defaultStyleProvider = element.getDefaultStyleProvider(); if (log.isDebugEnabled()) { log.debug("id=" + eqaKey + " x=" + x + ",y=" + y + ",w=" + w + ",h=" + h + ""); } JRBasePrintEllipse ellipse = new JRBasePrintEllipse(defaultStyleProvider); Object actualPage = element.getParameterValue("actualPage"); ellipse.setKey("" + eqaKey + "-" + actualPage); ellipse.setX(x); ellipse.setY(y); ellipse.setHeight(h); ellipse.setWidth(w); JRPrintText text = new JRBasePrintText(defaultStyleProvider); text.setForecolor(Color.RED); text.setX(x + 20); text.setY(y + 3); text.setHeight(10); text.setWidth(200); text.setText(eqaKey + " x=" + x + " y=" + y); try { xmlExporter.exportElement(ellipse); xmlExporter.exportText(text); } catch (Exception e) { throw new RuntimeException("Erro ao tentar exportar elemento", e); } }
/** * Especializa��o de GenericElementXmlHandler */ @Override public void exportElement(JRXmlExporterContext exporterContext, JRGenericPrintElement element) { Object eqaKey = element.getParameterValue("eqaKey"); exportAlternativeBullet(exporterContext, element, eqaKey); }
/** * Especialização de GenericElementXmlHandler */ @Override public void exportElement(JRXmlExporterContext exporterContext, JRGenericPrintElement element) { Object eqaKey = element.getParameterValue("eqaKey"); exportAlternativeBullet(exporterContext, element, eqaKey); }