Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.MemoryStringWriter


  private String readFromException(final Exception e)
  {
    String text = messages.getString("ExceptionDialog.USER_NO_BACKTRACE");//$NON-NLS-1$
    try
    {
      final MemoryStringWriter writer = new MemoryStringWriter();
      final PrintWriter pwriter = new PrintWriter(writer);
      e.printStackTrace(pwriter);
      text = writer.toString();
      pwriter.close();
    }
    catch (Exception ex)
    {
      ExceptionDialog.logger.info(messages.getString("ExceptionDialog.INFO_EXCEPTION_SUPRESSED")); //$NON-NLS-1$
View Full Code Here


    return writerService;
  }

  public static WriterService createBufferedService(OutputStream out, String encoding) throws UnsupportedEncodingException
  {
    MemoryStringWriter bufferWriter = new MemoryStringWriter(1024 * 512);
    XmlWriter xmlWriter = new XmlWriter(bufferWriter, createTagDefinitions());
    xmlWriter.setAdditionalIndent(1);
    xmlWriter.addImpliedNamespace(HtmlPrinter.XHTML_NAMESPACE, "");
    xmlWriter.setHtmlCompatiblityMode(true);

View Full Code Here

    assertEquals(utf8, utf16);
  }

  private String writeReport(final MasterReport report) throws IOException, ReportWriterException
  {
    final MemoryStringWriter oWriter = new MemoryStringWriter();
    final ReportWriter rc = new ReportWriter
        (report, "UTF-16", ReportWriter.createDefaultConfiguration(report));

    rc.addClassFactoryFactory(new URLClassFactory());
    rc.addClassFactoryFactory(new DefaultClassFactory());
    rc.addClassFactoryFactory(new BandLayoutClassFactory());
    rc.addClassFactoryFactory(new ArrayClassFactory());

    rc.addStyleKeyFactory(new DefaultStyleKeyFactory());
    rc.addStyleKeyFactory(new PageableLayoutStyleKeyFactory());
    rc.addTemplateCollection(new DefaultTemplateCollection());
    rc.addElementFactory(new DefaultElementFactory());
    rc.addDataSourceFactory(new DefaultDataSourceFactory());

    rc.write(oWriter);
    oWriter.close();
    return oWriter.toString();

  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.MemoryStringWriter

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.