|
|
|
|
|
|
JasperServer
 
Forums >  JasperServer Discussion/Help >  DOCX output not supported in web service 3.7  >
   
Go to bottom
  • Page:
  •  1 
JasperServer Discussion/Help Topic:
#69545
DOCX output not supported in web service 3.7 01/13/2010 00:25  

I'm using JasperServer 3.7 and am trying to output the OOXML docx format using the web service.  I know it can be done in the web browser.  I'm able to generate DOCX for the sample reports.  Sending the DOCX as the report format in a runReport SOAP call generates an error.  I can generate PDF and XLS documents just fine.

Also I find it odd that I can get a preview of a DOCX file in iReport but I can't save as a DOCX from the preview screen.  Seems like all supported versions should be available for save if you can preview them.  Preview saves the file, just in a place i don't necessarily want and loads up Office which I don't necessarily want either.

Thanks.

texodore
user photo
Project Roles
Posts: 5
graphgraph
Karma: 1
graphgraph
 
#69569
RE:DOCX output not supported in web service 3.7 01/13/2010 10:20  

Hi,

The active output formats available in the web services list are: pdf, html, rtf, csv and xml. But export channels are now pluggable, and you can add by your own any other output format to that list. In order to add the docx format, there are 3 steps to execute:

1. Create a class which implements the com.jaspersoft.jasperserver.ws.axis2.WSExporter interface, and name it DocxWSExporter. Here you have to implement the exportReport() method, which produces the output to the new docx format and returns a map of export parameters object. If custom export parameters are involved (ie, you want to give some specific default values for export parameters at application level), this class should contain also a com.jaspersoft.jasperserver.api.engine.jasperreports.common.ExportParameters property, named "exportParams". See for example the com.jaspersoft.jasperserver.ws.axis2.XlsWSExporter class.

2. In the jasperserver/jasperserver-war/src/main/webapp/WEB-INF/applicationContext-web-services.xml file create a new "docxExporter" bean object of type com.jaspersoft.jasperserver.ws.axis2.DocxWSExporter (it wraps exactly the DocxWSExporter object you created at point (1)). If the "exportParams" property is present, then the "docxExporter" bean should contain a property named "exportParams" too. See for example the "htmlExporter" and "xlsExporter" beans. Add a new entry in the "exportersMap" map object, similar to the already existing entries, containing "docx" as key and the "docxExporter" object as referenced value.

3. If customized values for the export parameters are needed, add a new entry in the "exportParametersMap" map object, similar to the already existing entries, containing "docx" as key and the "docxExportParameters" object as referenced value. If there is no "docxExportParameters" object in the jasperserver/jasperserver-war/src/main/webapp/WEB-INF/applicationContext.xml file, then create one first, and configure it. See the similar "xlsExportParameters" bean in the xml file. And do create the related "jobXlsExportParameters" bean in the jasperserver/jasperserver-war/src/main/webapp/WEB-INF/applicationContext-report-scheduling.xml file, in order to keep the scheduler up-to-date with these new additions.

Now the new export channel will be available.

Hope this helps,

sanda

 

shertage
user photo
Project Roles
QA Tester,SCM Committer
Posts: 190
graphgraph
Karma: 11
graphgraph
 
#69799
RE:DOCX output not supported in web service 3.7 01/17/2010 18:25  

I was kind of hoping that ultimately I wouldn't have to implement the export function since it is implemented elsewhere in the JasperServer.  In the web console I can export a docx version of the document.  I would expect This same functionality should be tavailable in the web service for all file types that are supported.

I guess what I'm saying is that if JasperReports and JasperServer support the format elsewhere, the web service should do the same without much modification if any.

Thanks for the help.  I'm going to try it and hope it works. 

texodore
user photo
Project Roles
Posts: 5
graphgraph
Karma: 1
graphgraph
 
#69847
RE:DOCX output not supported in web service 3.7 01/18/2010 19:14  

texodore,

In a case like this where JasperServer functionality isn't matching your expectations, please be sure to log a bug on the tracker. It's helpful if you could mention the bug number here for anyone reading this thread in the future.

Regards,
Matt

mdahlman
user photo
Project Roles
Posts: 741
graphgraph
Karma: 146
graphgraph
 
#69851
RE:DOCX output not supported in web service 3.7 01/18/2010 21:28  

Matt, thanks.  I'll be doing that shortly.  I'm looking to write some of the code as well, but am having some problems compiling CE 3.7 RC.  Separate topic...

texodore
user photo
Project Roles
Posts: 5
graphgraph
Karma: 1
graphgraph
 
#69860
RE:DOCX output not supported in web service 3.7 01/18/2010 23:39  

JS source should compile in trunk now.

tkavanagh
user photo
Project Roles
Project Admin,SCM Committer,Document Contributor,Content Manager,QA Tester
Posts: 431
graphgraph
Karma: 34
graphgraph
 
Go to top
  • Page:
  • 1
 
 
JasperForge Quotes
"This reporting tools is good and flexible."
 
Founding Member, Open Solutions Alliance       Hot Jasper Projects on SOURCEFORGE.NET       Powered by EssentiaESP