Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Spudsoft emitter Image and Chart not exported
mickpartyka
<p>Hello!</p><p> </p><p>I have a problem with spudsoft emitter for BIRT runtime environment.</p><p>I have no idea where I should indicate that BIRT should use spudsoft emitter instead of default emitter.</p><p>Maybe anyone can help me and tell me where I should include this code?</p><p>(I follow this page <a data-ipb='nomediaparse' href='
https://bitbucket.org/yaytay/spudsoft-birt-excel-emitters/wiki/Home'>https://bitbucket.org/yaytay/spudsoft-birt-excel-emitters/wiki/Home</a>)</p><p> </p><p>TIA</p><p> </p><p>Michal</p>
;
Find more posts tagged with
Comments
mwilliams
<p>So, you're writing Java code, not using the viewer?</p><p> </p><p>The code for using the emitter should look something like this:</p><p> </p><p> </p><pre class="_prettyXprint _linenums:0">IRenderOption options = null; options = new EXCELRenderOption(outputFormat: "xls"; options.setEmitterID("uk.co.spudsoft.birt.emitters.excel.XlsEmitter");</pre>
ashok22890@gmail.com
<p>Hello,</p><p> </p><p>I am new to BIRT.I am creating report in default BIRT emiiter and i will get output in xls. Now i need to add Bar chart in the same report.I got the bar chart in pdf format.But not in xls.</p><p> </p><p>i am using,</p><p>Eclipse: Kepler Service Release 1</p><p>BIRT :4.3(it contains plugin with default (uk.co.spudsoft.birt.emitters.excel_4.3.1.v201308301349) spudsoft.</p><p> </p><p>i dont do any integrations in eclipse and as well as birt with spudsoft.Guide me how to create report with Bar chart.</p><p> </p><p>Thanks,</p><p>Ashok</p>
jmaulny
<blockquote class="ipsBlockquote" data-author="ashok22890@gmail.com" data-cid="122701" data-time="1385456097"><div><p>Hello,</p><p> </p><p>I am new to BIRT.I am creating report in default BIRT emiiter and i will get output in xls. Now i need to add Bar chart in the same report.I got the bar chart in pdf format.But not in xls.</p><p> </p><p>i am using,</p><p>Eclipse: Kepler Service Release 1</p><p>BIRT :4.3(it contains plugin with default (uk.co.spudsoft.birt.emitters.excel_4.3.1.v201308301349) spudsoft.</p><p> </p><p>i dont do any integrations in eclipse and as well as birt with spudsoft.Guide me how to create report with Bar chart.</p><p> </p><p>Thanks,</p><p>Ashok</p></div></blockquote><p> </p><p>Try using the xls_spudsoft emitter :</p><p> </p><div> <pre class="_prettyXprint"> EXCELRenderOption xlsOptions = new EXCELRenderOption(); xlsOptions.setOutputFormat("xls_spudsoft"); xlsOptions.setBaseURL(baseUrl); xlsOptions.setImageHandler(new HTMLServerImageHandler()); xlsOptions.setOutputStream(resp.getOutputStream()); iRenderTask.setRenderOption(xlsOptions); </pre><p>Regards,</p><p>Jeremy</p></div>
ashok22890@gmail.com
<p>Hi jeremy,</p><p> </p><p>When i using this,</p><div><pre class="_prettyXprint">task = eng.createRunAndRenderTask(design); EXCELRenderOption xl=new EXCELRenderOption();xl.setOutputFormat("xls_spudsoft");xl.setEmitterID( "uk.co.spudsoft.birt.emitters.excel.XlsEmitter" );xl.setOutputFileName(reportoutput+"/"+reportsname); task.setRenderOption(xl);</pre><p>i got the above error.If i am not using,</p><pre class="_prettyXprint">xl.setOutputFormat("xls_spudsoft");xl.setEmitterID( "uk.co.spudsoft.birt.emitters.excel.XlsEmitter" );</pre><p>and used instead of,</p><pre class="_prettyXprint">xl.setOutputFormat("xls");</pre></div><p>i got an output.While using "xls_spudsoft" i got an error and i am using java.</p>
ashok22890@gmail.com
<p>Hi Jeremy,</p><p> </p><p>Here i attache my java file,please find and comment as the same.</p><p> </p><div> </div><div> </div><div><pre class="_prettyXprint">import org.eclipse.birt.report.engine.api.EXCELRenderOption;import org.eclipse.birt.report.engine.api.EngineConfig;import org.eclipse.birt.report.engine.api.IExcelRenderOption;import org.eclipse.birt.report.engine.api.IReportRunnable;import org.eclipse.birt.report.engine.api.IRunAndRenderTask;import org.eclipse.birt.report.engine.api.ReportEngine;public class CallReport{public CallReport() {String reports = "status_report.rptdesign"; String reportsname = "Report.xls"; String reportpath="C:/"; EngineConfig conf = null;ReportEngine eng = null;IReportRunnable design = null;IRunAndRenderTask task = null;String reportoutput="C:/";String exactreport = reportpath+"/"+reports;conf = new EngineConfig();conf.setEngineHome(" ");eng = new ReportEngine( conf );try{design = eng.openReportDesign(exactreport); } catch (Exception e){System.out.println("An error occured during the opening of the report file!");System.out.println(e);}task = eng.createRunAndRenderTask(design);EXCELRenderOption xl=new EXCELRenderOption();//xl.setOutputFormat("xls");xl.setOutputFormat("xls_spudsoft");xl.setEmitterID( "uk.co.spudsoft.birt.emitters.excel.XlsEmitter" );//xl.setOption(IExcelRenderOption.HIDE_GRIDLINES, new Boolean(true));xl.setOutputFileName(reportoutput+"/"+reportsname); task.setRenderOption(xl); try { task.run(); Thread.sleep(15000); } catch (Exception e) { System.out.println("An error occured while running the report!"); System.out.println(e); } System.out.println("Report Created"); eng.destroy();System.exit(0);}public static void main(String[] args) {CallReport obj = new CallReport(); }}</pre><p>Thanks,</p><p> </p><p>Ashok</p><p> </p></div>
jmaulny
<p>Do you have any Exception caught here :</p><p> </p><p> </p><blockquote class="ipsBlockquote"><p> </p><p> </p>[color=rgb(0,0,136);]try[/color]<br />
<span> </span>[color=rgb(102,102,0);]{[/color]<br />
<span> task</span>[color=rgb(102,102,0);].[/color]<span>run</span>[color=rgb(102,102,0);]();[/color]<br />
<span> </span>[color=rgb(102,0,102);]Thread[/color][color=rgb(102,102,0);].[/color]<span>sleep</span>[color=rgb(102,102,0);]([/color][color=rgb(0,102,102);]15000[/color][color=rgb(102,102,0);]);[/color]<br />
<span> </span>[color=rgb(102,102,0);]}[/color]<br />
<span> </span>[color=rgb(0,0,136);]catch[/color]<span> </span>[color=rgb(102,102,0);]([/color][color=rgb(102,0,102);]Exception[/color]<span> e</span>[color=rgb(102,102,0);])[/color]<br />
<span> </span>[color=rgb(102,102,0);]{[/color]<br />
<span> </span>[color=rgb(102,0,102);]System[/color][color=rgb(102,102,0);].[/color][color=rgb(0,0,136);]out[/color][color=rgb(102,102,0);].[/color]<span>println</span>[color=rgb(102,102,0);]([/color][color=rgb(0,136,0);]"An error occured while running the report!"[/color][color=rgb(102,102,0);]);[/color]<br />
<span> </span>[color=rgb(102,0,102);]System[/color][color=rgb(102,102,0);].[/color][color=rgb(0,0,136);]out[/color][color=rgb(102,102,0);].[/color]<span>println</span>[color=rgb(102,102,0);]([/color]<span>e</span>[color=rgb(102,102,0);]);[/color]<br />
<span> <br />
</span>[color=rgb(102,102,0);]}[/color]</blockquote><p> </p><p>?</p>
ashok22890@gmail.com
<p>Yeah,I got an exception and errors.</p><pre class="_prettyXprint">org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptionsSEVERE: An error happened while running the report. Cause:java.lang.ArrayIndexOutOfBoundsException: 60at org.eclipse.birt.report.engine.css.dom.ComputedStyle.getProperty(ComputedStyle.java:32)at uk.co.spudsoft.birt.emitters.excel.BirtStyle.<init>(BirtStyle.java:129)at uk.co.spudsoft.birt.emitters.excel.handlers.AbstractRealTableHandler.startTable(AbstractRealTableHandler.java:112)at uk.co.spudsoft.birt.emitters.excel.handlers.TopLevelTableHandler.startTable(TopLevelTableHandler.java:42)at uk.co.spudsoft.birt.emitters.excel.handlers.PageHandler.startTable(PageHandler.java:355)at uk.co.spudsoft.birt.emitters.excel.ExcelEmitter.startTable(ExcelEmitter.java:300)at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startTable(CompositeContentEmitter.java:306)at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startTable(HTMLTableLayoutEmitter.java:384)at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:50)at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:83)at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:79)at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:79)at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.flush(ContainerBufferNode.java:48)at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.endRow(HTMLPageBuffer.java:206)at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.endContainer(HTMLPageBuffer.java:140)at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.endContainer(TableBreakBuffer.java:360)at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.end(HTMLStackingLM.java:42)at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:141)at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:180)at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)at com.overall.CallReport.run(CallReport.java:415)at java.util.TimerThread.mainLoop(Timer.java:555)at java.util.TimerThread.run(Timer.java:505)An error occured while running the report!org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.</pre><p>Do the needful.Thanks.</p>
yusufnazir
<p>Hi All,</p><p> </p><p>Trying to work with the spudsoft emitter, but no file is generated.</p><p>I checked the code and when i switch back to default xls emitter the output file gets generated.</p><p>Also no exception is thrown.</p><p>I am using birt version 4.3.1</p><p> </p><p>I hope someone can give me a solution to my problem.</p><pre class="_prettyXprint">private RenderOption setReportOutputFormatForBirt(Long outputFormat, OutputStream outputStream) { RenderOption options = null; switch (outputFormat.intValue()) { case 2: options = new RenderOption(); options.setOutputStream(outputStream); options.setOutputFormat("doc"); break; case 3: options = new EXCELRenderOption(); options.setOutputStream(outputStream); options.setOutputFormat("xls_spudsoft"); options.setEmitterID("uk.co.spudsoft.birt.emitters.excel.XlsEmitter"); options.setOption(ExcelEmitter.STRUCTURED_HEADER, false); break; case 4: options = new PDFRenderOption(); options.setOutputStream(outputStream); options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF); break; case 5: break; default: break; } return options; }</pre>
A. Farhan
<blockquote class="ipsBlockquote" data-author="yusufnazir" data-cid="126772" data-time="1395171112"><div><p> </p><p>Hi All,</p><p> </p><p>Trying to work with the spudsoft emitter, but no file is generated.</p><p>I checked the code and when i switch back to default xls emitter the output file gets generated.</p><p>Also no exception is thrown.</p><p>I am using birt version 4.3.1</p><p> </p><p>I hope someone can give me a solution to my problem.</p><pre class="_prettyXprint">private RenderOption setReportOutputFormatForBirt(Long outputFormat, OutputStream outputStream) { RenderOption options = null; switch (outputFormat.intValue()) { case 2: options = new RenderOption(); options.setOutputStream(outputStream); options.setOutputFormat("doc"); break; case 3: options = new EXCELRenderOption(); options.setOutputStream(outputStream); options.setOutputFormat("xls_spudsoft"); options.setEmitterID("uk.co.spudsoft.birt.emitters.excel.XlsEmitter"); options.setOption(ExcelEmitter.STRUCTURED_HEADER, false); break; case 4: options = new PDFRenderOption(); options.setOutputStream(outputStream); options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF); break; case 5: break; default: break; } return options; }</pre><p>Yeah, I got this problem too. Care to share how to fix this? My BiRT Engine version is 4.3.1</p></div></blockquote>
mwilliams
I have no problem using the spudsoft emitter. Is the issue you're having only when you're using output stream? What are you doing with the output stream?
anil7496
<p>Hi All,</p>
<p> i am using birt 4.3.1 ,exporting data to xlsx files.here is the my code</p>
<pre class="_prettyXprint _lang-nocode">
// createData(object, title);
// end of mock data
//resp.setContentType("application/vnd.ms-excel");
resp.setHeader("Content-Disposition", "inline; filename="+title+".xlsx");
ServletContext sc = req.getSession().getServletContext();
IReportEngine birtReportEngine = BirtEngine.getBirtReportEngine(sc);
IReportRunnable design;
try {
// Open report design
design = birtReportEngine.openReportDesign(new ByteArrayInputStream(createReport(sc, title, req)));
// create task to run and render report
IRunAndRenderTask task = birtReportEngine
.createRunAndRenderTask(design);
Map<String, Object> contextMap = new HashMap<String, Object>();
contextMap.put("data", data);
task.setAppContext(contextMap);
IExcelRenderOption excelOptions = new EXCELRenderOption();
excelOptions.setOutputFormat("xlsx");
excelOptions.setOutputStream(resp.getOutputStream());
task.setRenderOption(excelOptions);
// run report
task.run();
task.close();
} catch (Exception e) {
e.printStackTrace();
throw new ServletException(e);
}
}
</pre>
<p>i am getting below error,</p>
<p> </p>
<p> </p>
<p>Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 60</p>
<p> at org.eclipse.birt.report.engine.css.dom.ComputedStyle.getProperty(ComputedStyle.java:32)</p>
<p> at uk.co.spudsoft.birt.emitters.excel.BirtStyle.<init>(BirtStyle.java:129)</p>
<p> at uk.co.spudsoft.birt.emitters.excel.handlers.AbstractRealTableHandler.startTable(AbstractRealTableHandler.java:112)</p>
<p> at uk.co.spudsoft.birt.emitters.excel.handlers.TopLevelTableHandler.startTable(TopLevelTableHandler.java:42)</p>
<p> at uk.co.spudsoft.birt.emitters.excel.handlers.PageHandler.startTable(PageHandler.java:355)</p>
<p> at uk.co.spudsoft.birt.emitters.excel.ExcelEmitter.startTable(ExcelEmitter.java:300)</p>
<p> at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startTable(CompositeContentEmitter.java:306)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startTable(HTMLTableLayoutEmitter.java:384)</p>
<p> at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:50)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:83)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:79)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:79)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:79)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:113)</p>
<p> at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:287)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:139)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)</p>
<p> at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)</p>
<p> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:180)</p>
<p> </p>
<p> </p>
<p>Any help on this would be Appreciable</p>
mwilliams
<p>I'm not sure it has to do with your Java code. It might be a bug with the spudsoft emitter and how it handles styles or something. At least that's what it looks like in your error stack.. Are you using css styles?</p>