本文整理汇总了Java中org.eclipse.birt.report.engine.api.HTMLRenderOption.setOutputStream方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLRenderOption.setOutputStream方法的具体用法?Java HTMLRenderOption.setOutputStream怎么用?Java HTMLRenderOption.setOutputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.birt.report.engine.api.HTMLRenderOption
的用法示例。
在下文中一共展示了HTMLRenderOption.setOutputStream方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testVisionOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputMasterPageMargins( true );
options.setEmbeddable( false );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<col style=\"width: 1.25in;\">";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例2: testInlineStyle
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testInlineStyle( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEmbeddable( true );
options.setEnableInlineStyle( true );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<style type=\"text/css\">";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
regex = "<div[^<>]*style=\"[^<>]*color: rgb(255, 0, 0)[^<>]*>aaaa</div>";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
}
示例3: testTableColumnWidth
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testTableColumnWidth( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/TableColumnWidth.xml";
HTMLRenderOption options = new HTMLRenderOption( );
options.setLayoutPreference( "fixed" );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "table-layout:fixed";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例4: testPerformanceOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testPerformanceOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEnableAgentStyleEngine( true );
options.setEmbeddable( true );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
//options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "text-decoration: underline;";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<div style=\" text-decoration: underline;\">";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
}
示例5: testVisionOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEnableAgentStyleEngine( false );
options.setEmbeddable( true );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
//options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<div style=\" text-decoration: underline;";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例6: runAndRender
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Run and render the report, and return the render result.
*
* @param designFile
* @return render result.
* @throws EngineException
* @throws IOException
*/
protected String runAndRender( String designFile ) throws EngineException,
IOException
{
IRunAndRenderTask runAndRenderTask = createRunAndRenderTask( designFile );
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream out = new ByteArrayOutputStream( );
options.setOutputStream( out );
options.setOutputFormat( "html" );
options.setHtmlPagination( true );
runAndRenderTask.setRenderOption( options );
runAndRenderTask.run( );
runAndRenderTask.close( );
String result = new String( out.toByteArray( ) );
out.close( );
return result;
}
示例7: renderPage
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
protected String renderPage( IReportDocument doc, long pageNo )
throws Exception
{
ByteArrayOutputStream buffer = new ByteArrayOutputStream( );
assertTrue( pageNo <= doc.getPageCount( ) );
IRenderTask renderTask = engine.createRenderTask( doc );
try
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputFormat( "html" );
options.setOutputStream( buffer );
renderTask.setRenderOption( options );
renderTask.setPageNumber( (long) pageNo );
renderTask.render( );
List errors = renderTask.getErrors( );
assertEquals( 0, errors.size( ) );
}
finally
{
renderTask.close( );
}
return new String( buffer.toString( "UTF-8" ) );
}
示例8: run
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void run( ) throws Exception
{
// render the generated report document
IReportDocument doc = engine.openReportDocument( fileName );
long pageCount = doc.getPageCount( );
for ( int i = 1; i <= pageCount; i++ )
{
IRenderTask renderTask = engine.createRenderTask( doc );
HTMLRenderOption option = new HTMLRenderOption( );
option.setOutputFormat( "html" );
option.setOutputStream( new ByteArrayOutputStream( ) );
renderTask.setRenderOption( option );
renderTask.setPageNumber( i );
renderTask.render( );
List errors = renderTask.getErrors( );
assertEquals( 0, errors.size( ) );
renderTask.close( );
}
doc.close( );
}
示例9: buildRenderOptions
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@Override
protected RenderOption buildRenderOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
HTMLRenderOption opt = new HTMLRenderOption();
opt.setEmitterID("io.github.kewne.spring_birt.htmlPlusEmbeddedSvg");
opt.setOutputFormat(HTMLRenderOption.HTML);
opt.setOutputStream(response.getOutputStream());
opt.setBaseImageURL(null);
opt.setImageDirectory(null);
opt.setEnableAgentStyleEngine(true);
return opt;
}
示例10: testCSSStyleClass
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testCSSStyleClass( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEmbeddable( true );
options.setEnableInlineStyle( false );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<style type=\"text/css\">";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<div[^<>]*class=\"[^<>]*CustomerStyle[^<>]*>aaaa</div>";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
regex = "<div[^<>]*style=\"[^<>]*color: rgb(255, 0, 0)[^<>]*>aaaa</div>";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
}
示例11: testScriptOutput
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testScriptOutput( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/comments.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "<!--comments1-->";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<!--comments2-->";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<!--comments3-->";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例12: testActionScript
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testActionScript( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/DrillThroughActionScriptTest.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "report-document";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "report-design";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例13: testScriptOutput
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testScriptOutput( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/ScriptOutputTest.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "<script[^<>]*>[^<>]*function test[^<>]*</script>"
+"[^<>]*<script[^<>]*src=\"birt/ajax/ui/app/BirtToolbar.js\"[^<>]*>[^<>]*</script>"
+"[^<>]*<script[^<>]*src=\"birt/ajax/ui/app/sdfsadfsadfasd.js\"[^<>]*>[^<>]*</script>";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例14: render
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Render a report design file and return the result.
*
* @param designFile
* @return render result.
* @throws EngineException
* @throws IOException
*/
protected String render( String designFile ) throws EngineException,
IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream out = new ByteArrayOutputStream( );
options.setOutputStream( out );
options.setOutputFormat( "html" );
render( designFile, options );
String result = new String( out.toByteArray( ) );
out.close( );
return result;
}
示例15: render
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Render a report design file and return the result.
*
* @param designFile
* @return render result.
* @throws EngineException
* @throws IOException
*/
protected String render( String designFile ) throws EngineException,
IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream out = new ByteArrayOutputStream( );
options.setOutputStream( out );
options.setHtmlPagination( true );
options.setOutputFormat( "html" );
render( designFile, options );
String result = new String( out.toByteArray( ) );
out.close( );
return result;
}