Java 类net.sf.jasperreports.engine.export.JRXmlExporter 实例源码

项目:bdf2    文件:JrpxmlExporter.java   
public void export(HttpServletRequest req, HttpServletResponse res)
        throws Exception {
    res.setContentType("text/xml");
    res.setHeader("Content-Disposition", "inline; filename=\"file.jrpxml\"");
    JRXmlExporter exporter = new JRXmlExporter(DefaultJasperReportsContext.getInstance());
    JasperPrint jasperPrint=this.getJasperPrint(req);
    exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint);
    //exporter.setParameter(JRExporterParameter.START_PAGE_INDEX, Integer.valueOf(1));
    OutputStream ouputStream = res.getOutputStream();
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
    try {
        exporter.exportReport();
    } catch (JRException e) {
        throw new ServletException(e);
    } finally {
        if (ouputStream != null) {
            ouputStream.flush();
            ouputStream.close();
        }
    }
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp) throws JazzOMRJRException {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:ParticipationHelperWS.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
private byte[] exportToXML(JasperPrint jp) {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzOMRRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzOMRRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:ParticipationHelperWS.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
private byte[] exportToXML(JasperPrint jp) {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp)  {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp) throws JazzOMRJRException {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp)  {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp) throws JazzOMRJRException {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:jasperreports    文件:JasperExportManager.java   
/**
 * Exports the generated report object received as parameter into XML format,
 * placing the result into the second file parameter.
 * <p>
 * If not embedded into the XML content itself using the Base64 encoder, 
 * the images are placed as distinct files inside a directory having the same name 
 * as the XML destination file, plus the "_files" suffix. 
 * 
 * @param jasperPrint       report object to export
 * @param destFileName      file name to place the XML representation into
 * @param isEmbeddingImages flag that indicates whether the images should be embedded in the
 *                          XML content itself using the Base64 encoder or be referenced as external resources
 *  
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public void exportToXmlFile(
    JasperPrint jasperPrint, 
    String destFileName,
    boolean isEmbeddingImages
    ) throws JRException
{
    JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));

    SimpleXmlExporterOutput xmlOutput = new SimpleXmlExporterOutput(destFileName);
    xmlOutput.setEmbeddingImages(isEmbeddingImages);
    exporter.setExporterOutput(xmlOutput);

    exporter.exportReport();
}
项目:jasperreports    文件:XmlValueHandlerUtils.java   
/**
 * Outputs the XML representation of a value if the value is supported by any handler.
 * 
 * @param value the value
 * @param exporter the exporter
 * @return <code>true</code> iff a handler that supports the value was found
 * @throws IOException
 * @see XmlValueHandler#writeToXml(Object, JRXmlExporter)
 */
public boolean writeToXml(Object value, JRXmlExporter exporter) throws IOException
{
    for (XmlValueHandler handler : getHandlers())
    {
        if (handler.writeToXml(value, exporter))
        {
            if (log.isDebugEnabled())
            {
                log.debug("Handler " + handler + " wrote value " + value);
            }

            return true;
        }
    }

    if (log.isDebugEnabled())
    {
        log.debug("No handler wrote value " + value);
    }

    return false;
}
项目:jasperreports    文件:JROdtExporter.java   
@Override
protected void initReport()
{
    super.initReport();

    if(jasperPrint.hasProperties() && jasperPrint.getPropertiesMap().containsProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS))
    {
        // allows null values for the property
        invalidCharReplacement = jasperPrint.getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS);
    }
    else
    {
        invalidCharReplacement = getPropertiesUtil().getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS, jasperPrint);
    }

    nature = new JROdtExporterNature(getJasperReportsContext(), filter);
}
项目:jasperreports    文件:JRPptxExporter.java   
@Override
protected void initReport()
{
    super.initReport();

    if (jasperPrint.hasProperties() && jasperPrint.getPropertiesMap().containsProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS))
    {
        // allows null values for the property
        invalidCharReplacement = jasperPrint.getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS);
    }
    else
    {
        invalidCharReplacement = getPropertiesUtil().getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS, jasperPrint);
    }

    renderersCache = new RenderersCache(getJasperReportsContext());
}
项目:jasperreports    文件:JRDocxExporter.java   
@Override
protected void initReport()
{
    super.initReport();

    if (jasperPrint.hasProperties() && jasperPrint.getPropertiesMap().containsProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS))
    {
        // allows null values for the property
        invalidCharReplacement = jasperPrint.getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS);
    }
    else
    {
        invalidCharReplacement = getPropertiesUtil().getProperty(JRXmlExporter.PROPERTY_REPLACE_INVALID_CHARS, jasperPrint);
    }

    DocxReportConfiguration configuration = getCurrentItemConfiguration();

    nature = 
        new JRDocxExporterNature(
            jasperReportsContext, 
            filter, 
            !configuration.isFramesAsNestedTables()
            );

    renderersCache = new RenderersCache(getJasperReportsContext());
}
项目:jasperreports    文件:MapElementXmlHandler.java   
@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);
    }
}
项目:jasperreports    文件:BaseElementsTests.java   
protected String elementToXml(JRPrintElement element)
{
    JRBasePrintPage page = new JRBasePrintPage();
    page.addElement(element);
    JasperPrint jasperPrint = new JasperPrint();
    jasperPrint.addPage(page);
    jasperPrint.setName("test");

    StringWriter writer = new StringWriter();
    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(writer);
    output.setEmbeddingImages(true);
    exporter.setExporterOutput(output);
    try
    {
        exporter.exportReport();
    }
    catch (JRException e)
    {
        throw new RuntimeException(e);
    }
    return writer.toString();
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp)  {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp)  {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzRuntimeException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param jp
 * @return
 * @throws JazzOMRJRException
 * @throws JRException
 */
protected byte[] exportToXML(JasperPrint jp) throws JazzOMRJRException {

    ByteArrayOutputStream baosXML = new ByteArrayOutputStream();

    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosXML);
    exporter.setParameter(JRXmlExporterParameter.IS_EMBEDDING_IMAGES, Boolean.FALSE);
    try {
        exporter.exportReport();
    } catch (JRException e1) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e1);
    }

    byte[] xmlBytes = null;
    try {
        baosXML.flush();
        xmlBytes = baosXML.toByteArray();
        baosXML.close();
    } catch (IOException e) {
        throw new JazzOMRJRException("Erro ao tentar exportar relatorio", e);
    }

    return xmlBytes;
}
项目:carbon-commons    文件:XMLReport.java   
public ByteArrayOutputStream generateXmlReport(JasperPrint jasperPrint)
        throws JRException, ReportingException {
    ByteArrayOutputStream xmlOutputStream = new ByteArrayOutputStream();
    if(jasperPrint==null){
        throw new ReportingException("jasperPrint null, can't convert to  XML report");
    }
    JRXmlExporter jrXmlExporter = new JRXmlExporter();
    jrXmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    jrXmlExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xmlOutputStream);
    try {
        jrXmlExporter.exportReport();

    } catch (JRException e) {
        throw new JRException("Error occurred exporting PDF report ", e);
    }
    return xmlOutputStream;
}
项目:nextreports-server    文件:JasperReportsUtil.java   
public static byte[] getXml(JasperPrint jasperPrint) throws JRException {
    byte[] content = null;
    ByteArrayOutputStream baos = null;
    try {
        baos = new ByteArrayOutputStream();
        JRXmlExporter exporter = new JRXmlExporter();
        content = getBytes(exporter, baos, jasperPrint);
    } finally {
        if (baos != null) {
            try {
                baos.flush();
                baos.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    return content;
}
项目:jasperreports    文件:JREmbeddedImagesXmlSaveContributor.java   
@Override
public void save(JasperPrint jasperPrint, File file) throws JRException
{
    if (
        !file.getName().toLowerCase().endsWith(EXTENSION_XML)
        && !file.getName().toLowerCase().endsWith(EXTENSION_JRPXML)
        )
    {
        file = new File(file.getAbsolutePath() + EXTENSION_JRPXML);
    }

    if (
        !file.exists() ||
        JOptionPane.OK_OPTION == 
            JOptionPane.showConfirmDialog(
                null, 
                MessageFormat.format(
                    getBundleString("file.exists"),
                    new Object[]{file.getName()}
                    ), 
                getBundleString("save"), 
                JOptionPane.OK_CANCEL_OPTION
                )
        )
    {
        JRXmlExporter exporter = new JRXmlExporter(getJasperReportsContext());
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); 
        SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(file);
        output.setEmbeddingImages(true);
        exporter.setExporterOutput(output);
        exporter.exportReport(); 
    }
}
项目:jasperreports    文件:JRXmlSaveContributor.java   
@Override
public void save(JasperPrint jasperPrint, File file) throws JRException
{
    if (
        !file.getName().toLowerCase().endsWith(EXTENSION_XML)
        && !file.getName().toLowerCase().endsWith(EXTENSION_JRPXML)
        )
    {
        file = new File(file.getAbsolutePath() + EXTENSION_JRPXML);
    }

    if (
        !file.exists() ||
        JOptionPane.OK_OPTION == 
            JOptionPane.showConfirmDialog(
                null, 
                MessageFormat.format(
                    getBundleString("file.exists"),
                    new Object[]{file.getName()}
                    ), 
                getBundleString("save"), 
                JOptionPane.OK_CANCEL_OPTION
                )
        )
    {
        JRXmlExporter exporter = new JRXmlExporter(getJasperReportsContext());
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); 
        SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(file);
        output.setEmbeddingImages(false);
        exporter.setExporterOutput(output);
        exporter.exportReport(); 
    }
}
项目:jasperreports    文件:JasperExportManager.java   
/**
 * Exports the generated report object supplied as the first parameter into XML format,
 * and writes the result to the output stream specified by the second parameter.
 * The images are embedded into the XML content itself using the Base64 encoder. 
 * 
 * @param jasperPrint  report object to export
 * @param outputStream output stream to write the resulting XML representation to
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public void exportToXmlStream(
    JasperPrint jasperPrint, 
    OutputStream outputStream
    ) throws JRException
{
    JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleXmlExporterOutput(outputStream));

    exporter.exportReport();
}
项目:jasperreports    文件:JasperExportManager.java   
/**
 * Exports the generated report object supplied as parameter into XML format
 * and returs the result as String.
 * The images are embedded into the XML content itself using the Base64 encoder. 
 * 
 * @param jasperPrint report object to export
 * @return XML representation of the generated report
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public String exportToXml(JasperPrint jasperPrint) throws JRException
{
    StringBuilder sb = new StringBuilder();

    JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleXmlExporterOutput(sb));

    exporter.exportReport();

    return sb.toString();
}
项目:jasperreports    文件:Report.java   
protected void xmlExport(JasperPrint print, OutputStream out) throws JRException, IOException
{
    JRXmlExporter exporter = new JRXmlExporter();
    exporter.setExporterInput(new SimpleExporterInput(print));
    SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(out);
    output.setEmbeddingImages(true);
    exporter.setExporterOutput(output);
    exporter.exportReport();
    out.close();
}
项目:PDFReporter-Studio    文件:ExportAsXmlWithImagesAction.java   
@Override
protected JRXmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRXmlExporter exp = new JRXmlExporter(jContext);
    SimpleXmlExporterOutput expOut = new SimpleXmlExporterOutput(file);
    expOut.setEmbeddingImages(Boolean.TRUE);
    exp.setExporterOutput(expOut);

    SimpleReportExportConfiguration rconf = new SimpleReportExportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXmlAction.java   
@Override
protected JRXmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRXmlExporter exp = new JRXmlExporter(jContext);
    SimpleXmlExporterOutput expOut = new SimpleXmlExporterOutput(file);
    expOut.setEmbeddingImages(Boolean.FALSE);
    exp.setExporterOutput(expOut);

    SimpleReportExportConfiguration rconf = new SimpleReportExportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);

    return exp;
}
项目:dynamicreports-jasper    文件:ExporterTransform.java   
private JRXmlExporter xml(JasperIXmlExporter jasperExporter) {
    SimpleXmlExporterOutput exporterOutput = simpleXmlExporterOutput(jasperExporter);
    if (jasperExporter.getEmbeddingImages() != null) {
        exporterOutput.setEmbeddingImages(jasperExporter.getEmbeddingImages());
    }
    SimpleReportExportConfiguration reportExportConfiguration = new SimpleReportExportConfiguration();
    reportExportConfiguration(reportExportConfiguration, jasperExporter);
    SimpleExporterConfiguration exporterConfiguration = new SimpleExporterConfiguration();

    JRXmlExporter jrExporter = new JRXmlExporter();
    jrExporter.setExporterOutput(exporterOutput);
    jrExporter.setConfiguration(reportExportConfiguration);
    jrExporter.setConfiguration(exporterConfiguration);
    return jrExporter;
}
项目:jasperreports-wms-component    文件:WmsMapElementXmlHandler.java   
@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);
  }
}
项目:jasperreports    文件:TextApp.java   
/**
 *
 */
public void xml() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/TextReport.jrprint");

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jrpxml");

    JRXmlExporter exporter = new JRXmlExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleXmlExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("XML creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:Xml4SwfServlet.java   
@Override
public JRXmlExporter getExporter()
{
    return new JRXml4SwfExporter(DefaultJasperReportsContext.getInstance());
}
项目:jasperreports    文件:XmlServlet.java   
/**
 * 
 */
public JRXmlExporter getExporter()
{
    return new JRXmlExporter(DefaultJasperReportsContext.getInstance());
}
项目:omr    文件:JazzOMRXMLHandler.java   
/**
 * 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);
    }
}
项目:omr    文件:JazzOMRXMLHandler.java   
/**
 * 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);
    }
}
项目:omr    文件:JazzOMRXMLHandler.java   
/**
 * 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);
    }
}
项目:omr    文件:JazzOMRXMLHandler.java   
/**
 * 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);
    }
}
项目:omr    文件:JazzOMRXMLHandler.java   
/**
 * 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);
    }
}
项目:enterprise-app    文件:AbstractReport.java   
public void exportToXml() {
    download(getFileName() + ".xml", new JRXmlExporter());
}
项目:konekti    文件:TemplateComponentReport.java   
public void exportToXml() {
    download(getFileName() + ".xml", new JRXmlExporter());
}
项目:konekti    文件:GridComponentReport.java   
public void exportToXml() {
    download(getFileName() + ".xml", new JRXmlExporter());
}