Package pl.net.bluesoft.rnd.pt.ext.report.model

Examples of pl.net.bluesoft.rnd.pt.ext.report.model.ReportTemplate


    public static JasperReport getReport(String reportName) {
        JasperReport jasperReport = null;
/*        ClassLoader previousLoader = null;
        Thread t = Thread.currentThread();*/
        try {
            ReportTemplate template = new ReportDAO().loadByName(reportName);
            if (template == null)
                throw new Exception("Report template does not exist for name: ".concat(reportName));
            ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
            ByteArrayInputStream contentInputStream = new ByteArrayInputStream(Base64.decodeBase64(
                    (new String(template.getContent())).getBytes("UTF-8")));
//            previousLoader = t.getContextClassLoader();
//            ClassLoader newClassLoader = ctx.getRegistry().getModelAwareClassLoader(
//                    JasperReportingUtil.class.getClassLoader());
//            t.setContextClassLoader(newClassLoader);
            jasperReport = JasperCompileManager.compileReport(contentInputStream);
View Full Code Here


    }
  }

  protected byte[] buildReport(ProcessInstance processInstance) throws ReportException {
    // LOAD TEMPLATE
    ReportTemplate template = new ReportDAO().loadByName(reportName);
    if (template == null)
      throw new ReportException("Report template does not exist!");
    // COMPILE REPORT
    JasperReport jasperReport = null;
    ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
    try {
      ByteArrayInputStream contentInputStream = getContentInputStream(template.getContent());
      Thread t = Thread.currentThread();
      ClassLoader previousLoader = t.getContextClassLoader();
      try {
        ClassLoader newClassLoader = ctx.getRegistry().getModelAwareClassLoader(getClass().getClassLoader());
        t.setContextClassLoader(newClassLoader);
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.pt.ext.report.model.ReportTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.