Java 类net.sf.jasperreports.engine.xml.JRPrintXmlLoader 实例源码

项目:wifepos    文件:JRViewer300.java   
/**
    * @param fileName
    * @param fileName
    * @param isXmlReport
    * @param isXmlReport
    * @throws net.sf.jasperreports.engine.JRException
    * @throws JRException
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(fileName);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObjectFromFile(fileName);
    }

    type = TYPE_FILE_NAME;
    this.isXML = isXmlReport;
    reportFileName = fileName;
    btnReload.setEnabled(true);
    setPageIndex(0);
}
项目:wifepos    文件:JRViewer300.java   
/**
    * @param is
    * @param is
    * @param isXmlReport
    * @throws JRException
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(is);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(is);
    }

    type = TYPE_INPUT_STREAM;
    this.isXML = isXmlReport;
    btnReload.setEnabled(false);
    setPageIndex(0);
}
项目:micro-Blagajna    文件:JRViewer300.java   
/**
    * @param fileName
    * @param fileName
    * @param isXmlReport
    * @param isXmlReport
    * @throws net.sf.jasperreports.engine.JRException
    * @throws JRException
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(fileName);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObjectFromFile(fileName);
    }

    type = TYPE_FILE_NAME;
    this.isXML = isXmlReport;
    reportFileName = fileName;
    btnReload.setEnabled(true);
    setPageIndex(0);
}
项目:micro-Blagajna    文件:JRViewer300.java   
/**
    * @param is
    * @param is
    * @param isXmlReport
    * @throws JRException
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(is);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(is);
    }

    type = TYPE_INPUT_STREAM;
    this.isXML = isXmlReport;
    btnReload.setEnabled(false);
    setPageIndex(0);
}
项目:PDFReporter-Studio    文件:PreviewJRPrint.java   
protected void loadJRPrint(IEditorInput input) throws PartInitException {
    InputStream in = null;
    try {
        IFile file = null;
        if (input instanceof IFileEditorInput) {
            file = ((IFileEditorInput) input).getFile();
            in = file.getContents();
        } else {
            throw new PartInitException("Invalid Input: Must be IFileEditorInput or FileStoreEditorInput"); //$NON-NLS-1$
        }
        Statistics stats = new Statistics();
        if (file.getFileExtension().equals(".jrpxml")) {
            setJasperPrint(stats, JRPrintXmlLoader.load(in));
        } else {
            Object obj = JRLoader.loadObject(in);
            if (obj instanceof JasperPrint)
                setJasperPrint(stats, (JasperPrint) obj);
        }
    } catch (Exception e) {
        throw new PartInitException("Invalid Input", e);
    }
}
项目:unicenta    文件:JRViewer300.java   
/**
    * @param fileName
    * @param fileName
    * @param isXmlReport
    * @param isXmlReport
    * @throws net.sf.jasperreports.engine.JRException
    * @throws JRException
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(fileName);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObjectFromFile(fileName);
    }

    type = TYPE_FILE_NAME;
    this.isXML = isXmlReport;
    reportFileName = fileName;
    btnReload.setEnabled(true);
    setPageIndex(0);
}
项目:unicenta    文件:JRViewer300.java   
/**
    * @param is
    * @param is
    * @param isXmlReport
    * @throws JRException
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(is);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(is);
    }

    type = TYPE_INPUT_STREAM;
    this.isXML = isXmlReport;
    btnReload.setEnabled(false);
    setPageIndex(0);
}
项目:nordpos    文件:JRViewer.java   
/**
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(jasperReportsContext, is);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(is);
    }

    type = TYPE_INPUT_STREAM;
    this.isXML = isXmlReport;
    btnReload.setEnabled(false);
    setPageIndex(0);
}
项目:OpenbravoPOS    文件:JRViewer300.java   
/**
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(fileName);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(fileName);
    }

    type = TYPE_FILE_NAME;
    this.isXML = isXmlReport;
    reportFileName = fileName;
    btnReload.setEnabled(true);
    setPageIndex(0);
}
项目:OpenbravoPOS    文件:JRViewer300.java   
/**
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
    if (isXmlReport)
    {
        jasperPrint = JRPrintXmlLoader.load(is);
    }
    else
    {
        jasperPrint = (JasperPrint)JRLoader.loadObject(is);
    }

    type = TYPE_INPUT_STREAM;
    this.isXML = isXmlReport;
    btnReload.setEnabled(false);
    setPageIndex(0);
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) {

    if(!log.isDebugEnabled())
        return;

    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzRuntimeException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) {

    if(!log.isDebugEnabled())
        return;

    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzRuntimeException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) {

    if(!log.isDebugEnabled())
        return;

    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzRuntimeException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:ParticipationHelper.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) {

    if(!log.isDebugEnabled())
        return;

    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzRuntimeException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:opennmszh    文件:JasperReportService.java   
private JasperPrint getJasperPrint(String location) throws JRException {
    if (location.contains("jrpxml")) {
        return JRPrintXmlLoader.load(location);
    } else {
        return (JasperPrint) JRLoader.loadObject(location);
    }
}
项目:OpenNMS    文件:JasperReportService.java   
private JasperPrint getJasperPrint(String location) throws JRException {
    if (location.contains("jrpxml")) {
        return JRPrintXmlLoader.load(location);
    } else {
        return (JasperPrint) JRLoader.loadObject(location);
    }
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) throws JazzOMRException {



    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzOMRException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) throws JazzOMRException {



    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzOMRException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) throws JazzOMRException {



    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzOMRException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}
项目:omr    文件:OMRModelTest.java   
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) throws JazzOMRException {



    byte[] pdfFromXML;
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
        JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
        JRPdfExporter pdfExporter = new JRPdfExporter();

        ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
        pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
        pdfExporter.exportReport();

        pdfFromXML = baosPDF.toByteArray();

    } catch (JRException e) {
        throw new JazzOMRException("erro ao tentar montar relatorio resultado do XML!", e);
    }

    writeToFile(pdfFromXML, "fromXML_"+pdfName);

    writeToFile(pdfBytes, pdfName);

    writeToFile(xmlBytes, xmlName);
}