Package br.com.caelum.stella.boleto.exception

Examples of br.com.caelum.stella.boleto.exception.GeracaoBoletoException


    try {
      b = new byte[is.available()];
      is.read(b);

    } catch (NumberFormatException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em HTML", e);
    } catch (IOException e) {
      throw new GeracaoBoletoException("Erro na geração do boleto em HTML", e);
    } finally {
      tentaFecharOFileOutput(is);
    }
    return b;
  }
View Full Code Here


   */
  public void geraHTML(String arquivo) {
    try {
      JasperExportManager.exportReportToHtmlFile(geraRelatorio(), arquivo);
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

    try {
      JRHtmlExporter exporter = getHtmlExporter(request);
      exporter.setParameter(JRHtmlExporterParameter.OUTPUT_WRITER, writer);
      exporter.exportReport()
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

      fonteSimples = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED);
      fonteBold = BaseFont.createFont(BaseFont.HELVETICA_BOLD, BaseFont.WINANSI, BaseFont.EMBEDDED);

    } catch (DocumentException e) {
      throw new GeracaoBoletoException(e);
    } catch (IOException e) {
      throw new GeracaoBoletoException(e);
    }

    document.open();
    contentByte = writer.getDirectContent();
    document.newPage();
View Full Code Here

      PdfTemplate template = contentByte.createTemplate(image.getWidth(), image.getHeight());
      template.addImage(pdfImage);
      final float leftMargin = document.leftMargin();
      contentByte.addTemplate(template, leftMargin + x, y);
    } catch (BadElementException e) {
      throw new GeracaoBoletoException(e);
    } catch (DocumentException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
    try {
      velocityEngine.init(config);
      template = velocityEngine.getTemplate("/br/com/caelum/stella/boleto/template_html.vm");
    } catch (Exception e) {
      throw new GeracaoBoletoException("Não foi possivel iniciar a configuração do Velocity", e);
    }
  }
View Full Code Here

    if (stream == null) {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try {
        ImageIO.write(PNGimage, "PNG", baos);
      } catch (IOException e) {
        throw new GeracaoBoletoException(e); // nao esperado
      }
      stream = new ByteArrayInputStream(baos.toByteArray());
    }
    return stream;
  }
View Full Code Here

   */
  public void geraHTML(String arquivo) {
    try {
      JasperExportManager.exportReportToHtmlFile(geraRelatorio(), arquivo);
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

    try {
      JRHtmlExporter exporter = getHtmlExporter(request);
      exporter.setParameter(JRHtmlExporterParameter.OUTPUT_WRITER, writer);
      exporter.exportReport()
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

      templateJasper = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default.jasper");
      parametros.put(JRParameter.REPORT_LOCALE, new Locale("pt", "BR"));
      InputStream template_sub = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default_instrucoes.jasper");
      parametros.put("SUB_INSTRUCOES", JRLoader.loadObject(template_sub));
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.boleto.exception.GeracaoBoletoException

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.