本文整理汇总了Java中org.eclipse.birt.report.engine.api.HTMLRenderOption.setEmbeddable方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLRenderOption.setEmbeddable方法的具体用法?Java HTMLRenderOption.setEmbeddable怎么用?Java HTMLRenderOption.setEmbeddable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.birt.report.engine.api.HTMLRenderOption
的用法示例。
在下文中一共展示了HTMLRenderOption.setEmbeddable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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( ) );
}
示例4: 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( ) );
}
示例5: testGetEmbeddable
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Test setEmbeddable(boolean embeddable) method Test getEmbeddable() method
*/
public void testGetEmbeddable( ) throws Exception
{
HTMLRenderOption option = new HTMLRenderOption( );
boolean bEmbed = true, bEmbedGet;
option.setEmbeddable( bEmbed );
bEmbedGet = option.getEmbeddable( );
assertEquals( "set/getEmbeddable() fail", bEmbed, bEmbedGet );
}
示例6: 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( ) );
}
示例7: run
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
void run(IReportRunnable reportRunnable, String format, TimeZone timeZone, String htmlType, String targetFile, JsonObject values)
throws EngineException {
ReportParametersInspector inspector = new ReportParametersInspector(reportEngine);
List<IParameterDefnBase> parameters = inspector.getParameters(reportRunnable);
Map<String, String> map = new HashMap<String, String>(parameters.size());
flattenParameters(inspector, parameters, map);
IRunAndRenderTask task = reportEngine.createRunAndRenderTask(reportRunnable);
for(IParameterDefnBase param: parameters){
String name = param.getName();
if(values.containsKey(name)){
setParameter(task, name, map.get(name), values.get(name));
}
}
// set report render options
IRenderOption options = new RenderOption();
options.setOutputFormat(format);
// setup the output file
options.setOutputFileName(targetFile);
// setup the application context
if (format.equalsIgnoreCase("html")) {
HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
if ("ReportletNoCSS".equals(htmlType)) {
htmlOptions.setEmbeddable(true);
}
// setup the output encoding
htmlOptions.setUrlEncoding(encoding);
htmlOptions.setHtmlPagination(true);
htmlOptions.setImageDirectory("image"); //$NON-NLS-1$
}
// set the render options
task.setRenderOption(options);
// setup the locale
task.setLocale(getLocale(locale));
task.setTimeZone(timeZone);
task.run();
task.close();
}
示例8: renderHtmlReport
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@Override
public void renderHtmlReport(String reportName,
Map<String, Object> parameters, OutputStream out, long pageNumber,
boolean overwrite) throws BirtReportException {
try {
String reportFileName = absolutePathOf(reportFileName(reportName));
String documentFileName = absoluteTempPath(
documentFileName(reportName));
recreateReportDocument(reportName, parameters, overwrite,
reportFileName, documentFileName);
IReportDocument reportDocument = reportEngine
.openReportDocument(documentFileName);
HTMLRenderOption htmlOptions = new HTMLRenderOption();
htmlOptions.setOutputFormat(IRenderOption.OUTPUT_FORMAT_HTML);
htmlOptions.setOutputStream(out);
htmlOptions.setImageHandler(new HTMLServerImageHandler());
htmlOptions.setEmbeddable(true);
htmlOptions.setBaseImageURL(baseImageURL);
htmlOptions.setImageDirectory(imageDirectory);
htmlOptions.setHtmlPagination(true);
htmlOptions.setMasterPageContent(false);
htmlOptions.setPageFooterFloatFlag(true);
IRenderTask renderTask = reportEngine
.createRenderTask(reportDocument,
reportDocument.getReportRunnable());
renderTask.setRenderOption(htmlOptions);
renderTask.setPageNumber(pageNumber);
injectLocale(renderTask);
renderTask.render();
renderTask.close();
} catch (EngineException | IOException e) {
throw new BirtReportException(e);
}
}