Home » Archived » BIRT » How to generate XLS or DOC by using REAPI
|
Re: How to generate XLS or DOC by using REAPI [message #250415 is a reply to message #250369] |
Mon, 30 July 2007 16:30 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Peng,
You just need to use the RenderOption class like this:
IReportDocument document = null;
//Open the report design
document
=engine.openReportDocument("output/resample/customers.rptdocument ");
IRenderOption options = new RenderOption();
options.setOutputFormat("xls");
options.setOutputFileName("output/resample/customers.xls");
IRenderTask task = engine.createRenderTask(document);
task.setRenderOption(options);
Jason
Peng wrote:
> Hi,
> does anyone know how to generate XLS or DOC format per Birt 2.2 Report
> Engine API ?
>
> i can generate PDF and HTML by using HTML- or PDFRenderOption
> programtically, but until now still don not find any example about how
> to use Birt 2.2 REAPI to generate XLS or DOC programmatically. Some
> prevoius discussions about it do not also give any ideas.
>
> thanks in advance
|
|
| |
Re: How to generate XLS or DOC by using REAPI [message #250751 is a reply to message #250689] |
Wed, 01 August 2007 14:40 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Can you post the entire stack trace.
Here is the complete sample I used:
Jason
import java.util.HashMap;
import java.util.logging.Level;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLActionHandler;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.PDFRenderOption;
import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IReportDocument;
import org.eclipse.birt.report.engine.api.IRenderTask;
import org.eclipse.birt.report.engine.api.IRenderOption;
import org.eclipse.birt.report.engine.api.RenderOption;
import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
import org.eclipse.birt.report.engine.api.IPDFRenderOption;
public class RenderTaskXLS {
public void runReport() throws EngineException
{
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("C:/birt/birt-runtime-2_2_0/birt-runtime-2_2_0/ReportEngine ");
config.setLogConfig(null, Level.FINE);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
}catch( Exception ex){
ex.printStackTrace();
}
IReportDocument document = null;
//Open the report design
document =
engine.openReportDocument("output/resample/customers.rptdocument ");
IRenderOption options = new RenderOption();
options.setOutputFormat("xls");
options.setOutputFileName("output/resample/customers.xls");
IRenderTask task = engine.createRenderTask(document);
task.setRenderOption(options);
task.render();
task.close();
engine.destroy();
Platform.shutdown();
System.out.println("Finished");
}
/**
* @param args
*/
public static void main(String[] args) {
try
{
RenderTaskXLS ex = new RenderTaskXLS( );
ex.runReport();
}
catch ( Exception e )
{
e.printStackTrace();
}
}
}
Said wrote:
> Hi,
> I tried the this example but I get the following error:
>
> org.eclipse.birt.report.engine.api.EngineException
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:395)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:342)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDocument(ReportEngine.java:423)
>
>
|
|
|
Re: How to generate XLS or DOC by using REAPI [message #250840 is a reply to message #250751] |
Wed, 01 August 2007 21:52 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: xxxx.xxx.com
Jason, I could be able to generate a report output in XLS but I am
getting annoying log messages as follows in my dos window where I run
the Java class:
add data col = 0
Get Data = [0,0]
Get Data = [0,0]
add data col = 1
Get Data = [1,0]
Get Data = [1,0]
add data col = 2
Get Data = [2,0]
Get Data = [2,0]
Get Data = [0,0]
Get Data = [1,0]
Get Data = [2,0]
Get Data = [0,0]
Is there any way I can avoid this?
Thanks
Jason Weathersby wrote:
> Can you post the entire stack trace.
>
> Here is the complete sample I used:
>
> Jason
>
> import java.util.HashMap;
> import java.util.logging.Level;
>
> import org.eclipse.birt.core.framework.Platform;
> import org.eclipse.birt.report.engine.api.EngineConfig;
> import org.eclipse.birt.report.engine.api.EngineConstants;
> import org.eclipse.birt.report.engine.api.EngineException;
> import org.eclipse.birt.report.engine.api.HTMLActionHandler;
> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
> import org.eclipse.birt.report.engine.api.PDFRenderOption;
> import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
> import org.eclipse.birt.report.engine.api.IReportEngine;
> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
> import org.eclipse.birt.report.engine.api.IReportRunnable;
> import org.eclipse.birt.report.engine.api.IReportDocument;
>
> import org.eclipse.birt.report.engine.api.IRenderTask;
> import org.eclipse.birt.report.engine.api.IRenderOption;
> import org.eclipse.birt.report.engine.api.RenderOption;
> import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
> import org.eclipse.birt.report.engine.api.IPDFRenderOption;
>
>
>
>
>
> public class RenderTaskXLS {
>
> public void runReport() throws EngineException
> {
>
> IReportEngine engine=null;
> EngineConfig config = null;
>
> try{
>
> config = new EngineConfig( );
>
> config.setBIRTHome("C:/birt/birt-runtime-2_2_0/birt-runtime-2_2_0/ReportEngine ");
>
> config.setLogConfig(null, Level.FINE);
> Platform.startup( config );
> IReportEngineFactory factory = (IReportEngineFactory)
> Platform.createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> engine = factory.createReportEngine( config );
> }catch( Exception ex){
> ex.printStackTrace();
> }
>
> IReportDocument document = null;
> //Open the report design
> document =
> engine.openReportDocument("output/resample/customers.rptdocument ");
>
> IRenderOption options = new RenderOption();
>
> options.setOutputFormat("xls");
> options.setOutputFileName("output/resample/customers.xls");
>
>
>
> IRenderTask task = engine.createRenderTask(document);
> task.setRenderOption(options);
>
> task.render();
>
>
>
>
>
> task.close();
> engine.destroy();
> Platform.shutdown();
> System.out.println("Finished");
> }
>
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> try
> {
>
> RenderTaskXLS ex = new RenderTaskXLS( );
> ex.runReport();
>
> }
> catch ( Exception e )
> {
> e.printStackTrace();
> }
> }
>
>
> }
>
> Said wrote:
>> Hi,
>> I tried the this example but I get the following error:
>>
>> org.eclipse.birt.report.engine.api.EngineException
>> at
>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:395)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:342)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDocument(ReportEngine.java:423)
>>
>>
|
|
|
Re: How to generate XLS or DOC by using REAPI [message #250871 is a reply to message #250840] |
Thu, 02 August 2007 03:32 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Can you set the log level to OFF?
Jason
Kris wrote:
> Jason, I could be able to generate a report output in XLS but I am
> getting annoying log messages as follows in my dos window where I run
> the Java class:
>
> add data col = 0
> Get Data = [0,0]
> Get Data = [0,0]
> add data col = 1
> Get Data = [1,0]
> Get Data = [1,0]
> add data col = 2
> Get Data = [2,0]
> Get Data = [2,0]
> Get Data = [0,0]
> Get Data = [1,0]
> Get Data = [2,0]
> Get Data = [0,0]
>
> Is there any way I can avoid this?
>
> Thanks
>
>
> Jason Weathersby wrote:
>> Can you post the entire stack trace.
>>
>> Here is the complete sample I used:
>>
>> Jason
>>
>> import java.util.HashMap;
>> import java.util.logging.Level;
>>
>> import org.eclipse.birt.core.framework.Platform;
>> import org.eclipse.birt.report.engine.api.EngineConfig;
>> import org.eclipse.birt.report.engine.api.EngineConstants;
>> import org.eclipse.birt.report.engine.api.EngineException;
>> import org.eclipse.birt.report.engine.api.HTMLActionHandler;
>> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
>> import org.eclipse.birt.report.engine.api.PDFRenderOption;
>> import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
>> import org.eclipse.birt.report.engine.api.IReportEngine;
>> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
>> import org.eclipse.birt.report.engine.api.IReportRunnable;
>> import org.eclipse.birt.report.engine.api.IReportDocument;
>>
>> import org.eclipse.birt.report.engine.api.IRenderTask;
>> import org.eclipse.birt.report.engine.api.IRenderOption;
>> import org.eclipse.birt.report.engine.api.RenderOption;
>> import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
>> import org.eclipse.birt.report.engine.api.IPDFRenderOption;
>>
>>
>>
>>
>>
>> public class RenderTaskXLS {
>>
>> public void runReport() throws EngineException
>> {
>>
>> IReportEngine engine=null;
>> EngineConfig config = null;
>>
>> try{
>> config = new EngineConfig( );
>> config.setBIRTHome("C:/birt/birt-runtime-2_2_0/birt-runtime-2_2_0/ReportEngine ");
>>
>> config.setLogConfig(null, Level.FINE);
>> Platform.startup( config );
>> IReportEngineFactory factory = (IReportEngineFactory)
>> Platform.createFactoryObject(
>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>> engine = factory.createReportEngine( config );
>> }catch( Exception ex){
>> ex.printStackTrace();
>> }
>>
>> IReportDocument document = null;
>> //Open the report design
>> document =
>> engine.openReportDocument("output/resample/customers.rptdocument ");
>>
>> IRenderOption options = new RenderOption();
>> options.setOutputFormat("xls");
>> options.setOutputFileName("output/resample/customers.xls");
>>
>> IRenderTask task = engine.createRenderTask(document);
>> task.setRenderOption(options);
>> task.render();
>>
>>
>>
>> task.close();
>> engine.destroy();
>> Platform.shutdown();
>> System.out.println("Finished");
>> }
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> try
>> {
>>
>> RenderTaskXLS ex = new RenderTaskXLS( );
>> ex.runReport();
>>
>> }
>> catch ( Exception e )
>> {
>> e.printStackTrace();
>> }
>> }
>>
>> }
>>
>> Said wrote:
>>> Hi,
>>> I tried the this example but I get the following error:
>>>
>>> org.eclipse.birt.report.engine.api.EngineException
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:395)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:342)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDocument(ReportEngine.java:423)
>>>
>>>
|
|
| |
Re: How to generate XLS or DOC by using REAPI [message #252545 is a reply to message #250840] |
Wed, 15 August 2007 15:26 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: xxxx.xxx.com
Jason, I couldnt stop (with log level OFF) displaying these messaged
from printing. One thing I am noticing about these messages that they
dont look like (message format) they are from the logger but from a
debug statement like System.out.println().
Is there any possibility that any developer could ve left that debug
statement in there and forgot to take it out?
Thanks
Kris wrote:
> Jason, I could be able to generate a report output in XLS but I am
> getting annoying log messages as follows in my dos window where I run
> the Java class:
>
> add data col = 0
> Get Data = [0,0]
> Get Data = [0,0]
> add data col = 1
> Get Data = [1,0]
> Get Data = [1,0]
> add data col = 2
> Get Data = [2,0]
> Get Data = [2,0]
> Get Data = [0,0]
> Get Data = [1,0]
> Get Data = [2,0]
> Get Data = [0,0]
>
> Is there any way I can avoid this?
>
> Thanks
>
>
> Jason Weathersby wrote:
>> Can you post the entire stack trace.
>>
>> Here is the complete sample I used:
>>
>> Jason
>>
>> import java.util.HashMap;
>> import java.util.logging.Level;
>>
>> import org.eclipse.birt.core.framework.Platform;
>> import org.eclipse.birt.report.engine.api.EngineConfig;
>> import org.eclipse.birt.report.engine.api.EngineConstants;
>> import org.eclipse.birt.report.engine.api.EngineException;
>> import org.eclipse.birt.report.engine.api.HTMLActionHandler;
>> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
>> import org.eclipse.birt.report.engine.api.PDFRenderOption;
>> import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
>> import org.eclipse.birt.report.engine.api.IReportEngine;
>> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
>> import org.eclipse.birt.report.engine.api.IReportRunnable;
>> import org.eclipse.birt.report.engine.api.IReportDocument;
>>
>> import org.eclipse.birt.report.engine.api.IRenderTask;
>> import org.eclipse.birt.report.engine.api.IRenderOption;
>> import org.eclipse.birt.report.engine.api.RenderOption;
>> import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
>> import org.eclipse.birt.report.engine.api.IPDFRenderOption;
>>
>>
>>
>>
>>
>> public class RenderTaskXLS {
>>
>> public void runReport() throws EngineException
>> {
>>
>> IReportEngine engine=null;
>> EngineConfig config = null;
>>
>> try{
>> config = new EngineConfig( );
>> config.setBIRTHome("C:/birt/birt-runtime-2_2_0/birt-runtime-2_2_0/ReportEngine ");
>>
>> config.setLogConfig(null, Level.FINE);
>> Platform.startup( config );
>> IReportEngineFactory factory = (IReportEngineFactory)
>> Platform.createFactoryObject(
>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>> engine = factory.createReportEngine( config );
>> }catch( Exception ex){
>> ex.printStackTrace();
>> }
>>
>> IReportDocument document = null;
>> //Open the report design
>> document =
>> engine.openReportDocument("output/resample/customers.rptdocument ");
>>
>> IRenderOption options = new RenderOption();
>> options.setOutputFormat("xls");
>> options.setOutputFileName("output/resample/customers.xls");
>>
>> IRenderTask task = engine.createRenderTask(document);
>> task.setRenderOption(options);
>> task.render();
>>
>>
>>
>> task.close();
>> engine.destroy();
>> Platform.shutdown();
>> System.out.println("Finished");
>> }
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> try
>> {
>>
>> RenderTaskXLS ex = new RenderTaskXLS( );
>> ex.runReport();
>>
>> }
>> catch ( Exception e )
>> {
>> e.printStackTrace();
>> }
>> }
>>
>> }
>>
>> Said wrote:
>>> Hi,
>>> I tried the this example but I get the following error:
>>>
>>> org.eclipse.birt.report.engine.api.EngineException
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:395)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:342)
>>>
>>> at
>>> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDocument(ReportEngine.java:423)
>>>
>>>
|
|
|
Re: How to generate XLS or DOC by using REAPI [message #252574 is a reply to message #252545] |
Wed, 15 August 2007 18:45 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Der Spunk![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=spunk_der%40hotmail.com) Messages: 58 Registered: July 2009 |
Member |
|
|
Please have a look at bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=198843
It is fixed in 2.2.1.
Spunk
"Kris" <xxxx@xxx.com> schrieb im Newsbeitrag
news:f9v5vh$rt2$1@build.eclipse.org...
> Jason, I couldnt stop (with log level OFF) displaying these messaged from
> printing. One thing I am noticing about these messages that they dont look
> like (message format) they are from the logger but from a debug statement
> like System.out.println().
>
> Is there any possibility that any developer could ve left that debug
> statement in there and forgot to take it out?
>
> Thanks
>
> Kris wrote:
>> Jason, I could be able to generate a report output in XLS but I am
>> getting annoying log messages as follows in my dos window where I run the
>> Java class:
>>
>> add data col = 0
>> Get Data = [0,0]
>> Get Data = [0,0]
>> add data col = 1
>> Get Data = [1,0]
>> Get Data = [1,0]
>> add data col = 2
>> Get Data = [2,0]
>> Get Data = [2,0]
>> Get Data = [0,0]
>> Get Data = [1,0]
>> Get Data = [2,0]
>> Get Data = [0,0]
>>
>> Is there any way I can avoid this?
>>
>> Thanks
>>
>>
>> Jason Weathersby wrote:
>>> Can you post the entire stack trace.
>>>
>>> Here is the complete sample I used:
>>>
>>> Jason
>>>
>>> import java.util.HashMap;
>>> import java.util.logging.Level;
>>>
>>> import org.eclipse.birt.core.framework.Platform;
>>> import org.eclipse.birt.report.engine.api.EngineConfig;
>>> import org.eclipse.birt.report.engine.api.EngineConstants;
>>> import org.eclipse.birt.report.engine.api.EngineException;
>>> import org.eclipse.birt.report.engine.api.HTMLActionHandler;
>>> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
>>> import org.eclipse.birt.report.engine.api.PDFRenderOption;
>>> import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
>>> import org.eclipse.birt.report.engine.api.IReportEngine;
>>> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
>>> import org.eclipse.birt.report.engine.api.IReportRunnable;
>>> import org.eclipse.birt.report.engine.api.IReportDocument;
>>>
>>> import org.eclipse.birt.report.engine.api.IRenderTask;
>>> import org.eclipse.birt.report.engine.api.IRenderOption;
>>> import org.eclipse.birt.report.engine.api.RenderOption;
>>> import org.eclipse.birt.report.engine.api.IHTMLRenderOption;
>>> import org.eclipse.birt.report.engine.api.IPDFRenderOption;
>>>
>>>
>>>
>>>
>>>
>>> public class RenderTaskXLS {
>>>
>>> public void runReport() throws EngineException
>>> {
>>>
>>> IReportEngine engine=null;
>>> EngineConfig config = null;
>>>
>>> try{
>>> config = new EngineConfig( );
>>> config.setBIRTHome("C:/birt/birt-runtime-2_2_0/birt-runtime-2_2_0/ReportEngine ");
>>> config.setLogConfig(null, Level.FINE);
>>> Platform.startup( config );
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>> Platform.createFactoryObject(
>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>> engine = factory.createReportEngine( config );
>>> }catch( Exception ex){
>>> ex.printStackTrace();
>>> }
>>>
>>> IReportDocument document = null;
>>> //Open the report design
>>> document =
>>> engine.openReportDocument("output/resample/customers.rptdocument ");
>>>
>>> IRenderOption options = new RenderOption();
>>> options.setOutputFormat("xls");
>>> options.setOutputFileName("output/resample/customers.xls");
>>> IRenderTask task = engine.createRenderTask(document);
>>> task.setRenderOption(options);
>>> task.render();
>>>
>>>
>>> task.close();
>>> engine.destroy();
>>> Platform.shutdown();
>>> System.out.println("Finished");
>>> }
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> try
>>> {
>>>
>>> RenderTaskXLS ex = new RenderTaskXLS( );
>>> ex.runReport();
>>>
>>> }
>>> catch ( Exception e )
>>> {
>>> e.printStackTrace();
>>> }
>>> }
>>>
>>> }
>>>
>>> Said wrote:
>>>> Hi,
>>>> I tried the this example but I get the following error:
>>>>
>>>> org.eclipse.birt.report.engine.api.EngineException
>>>> at
>>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:395)
>>>> at
>>>> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDocument(ReportEngineHelper.java:342)
>>>> at
>>>> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDocument(ReportEngine.java:423)
>>>>
|
|
|
Goto Forum:
Current Time: Mon Jul 22 02:17:45 GMT 2024
Powered by FUDForum. Page generated in 0.04213 seconds
|