Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Using new Docx Emitter programmatically
Using new Docx Emitter programmatically [message #1129372] Tue, 08 October 2013 15:06 Go to next message
Robert Walter is currently offline Robert WalterFriend
Messages: 29
Registered: July 2011
Junior Member
Hi,

I tried to upgrade to Birt 4.3.1 in order to make use of the new docx emitter.

I tried to use it by using DocxRenderOptions and setting the outputFormat to "docx" and writing a file with the docx extension. However, Birt tell me that "docx" is not supported (yes, I'm sure I compile against 4.3.1).
The format extension "docx" is just not in the format2MIMEType list.

So I figured I need to explicitly setting the emitter ID. However, using "org.eclipse.birt.report.engine.emitter.docx" leads to another exception telling me this emitter is not valid.

What am I doing wrong? here's my code setting the render options:
case DOCX:
	DocxRenderOption docxRenderOption = new DocxRenderOption();
	OutputStream docxStream = createOutputStream(format); // format needs to be "doc" in order to make it happen
	if (docxStream != null) {
		docxRenderOption.setOutputStream(docxStream);
	} else {
		docxRenderOption.setOutputFileName(getOutputFileName(format));
	}
	docxRenderOption.setOutputFormat(getBIRTFormat(format)); // getBirtFormat returns doc in order to make it happen
	docxRenderOption.setEmitterID("org.eclipse.birt.report.engine.emitter.docx"); // this does not work... why? Even when format is docx it does not work
	docxRenderOption.setOption(IRenderOption.HTML_PAGINATION, Boolean.TRUE);
	docxRenderOption.setOption(IRenderOption.RENDER_DPI, 96);
	docxRenderOption.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.FIT_TO_PAGE_SIZE);
	return docxRenderOption;
Re: Using new Docx Emitter programmatically [message #1129447 is a reply to message #1129372] Tue, 08 October 2013 16:34 Go to previous messageGo to next message
Robert Walter is currently offline Robert WalterFriend
Messages: 29
Registered: July 2011
Junior Member
Okay, I figured that I missed to add some dependencies in the platform feature.
These are:
* org.eclipse.birt.report.engine.emitter.config.docx
* org.eclipse.birt.report.engine.emitter.docx
* org.eclipse.birt.report.engine.ooxml
Re: Using new Docx Emitter programmatically [message #1142848 is a reply to message #1129447] Thu, 17 October 2013 22:19 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1663
Registered: July 2009
Senior Member

Glad you got it working!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Using new Docx Emitter programmatically [message #1354938 is a reply to message #1142848] Wed, 14 May 2014 13:47 Go to previous messageGo to next message
Lukas Schmid is currently offline Lukas SchmidFriend
Messages: 1
Registered: May 2014
Junior Member
I'm using the same method as Robert. But I'm always getting the error:
EmitterID org.eclipse.birt.report.engine.emitter.docx for render option is invalid.

I have included the following library to my project: org.eclipse.birt.runtime_4.3.2.v20140225-1404.jar
This library includes the package "rg.eclipse.birt.report.engine.emitter.docx" - The package is as well accessible in the class.

Do you have any idea how I may use the docx emitter?
Thank you very much.
Re: Using new Docx Emitter programmatically [message #1371796 is a reply to message #1354938] Wed, 21 May 2014 14:47 Go to previous message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
Lukas Schmid wrote:
> I'm using the same method as Robert. But I'm always getting the error:
> EmitterID org.eclipse.birt.report.engine.emitter.docx for render option
> is invalid.
>
> I have included the following library to my project:
> org.eclipse.birt.runtime_4.3.2.v20140225-1404.jar
> This library includes the package
> "rg.eclipse.birt.report.engine.emitter.docx" - The package is as well
> accessible in the class.
>
> Do you have any idea how I may use the docx emitter?
> Thank you very much.

What version of BIRT are you using? Can you explain your problem a
little more?
Previous Topic:xls export failing for large data Birt 2.6.2
Next Topic:BIRT bug when adding a parameter to a data set
Goto Forum:
  


Current Time: Mon Nov 24 09:33:03 GMT 2014

Powered by FUDForum. Page generated in 0.03461 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software