My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

Server-side javascript service to generate Jasper report from XML data-source which is generated by FTL

How it works

- create FTL which will be executed agains Alfresco repository that will produce XML data-source

- create Jasper report using iReport and place it on repository

- use Server-side alfresco javascript to execute FTL and execute alfresco-jasper-report service with provided jasper-report node

Installation

  • copy jar libraries to your /alfresco/WEB-INF/lib/ folder
    • alfrescoJasperReports.jar
    • jasper report libraries (jasperreports-4.0.2.jar, jasperreports-applet-4.0.2.jar, jasperreports-fonts-4.0.2.jar, jasperreports-javaflow-4.0.2.jar)
    • other dependency jars. Note that alfresco already contains commons-, iText and log4j libraries. Only iText-2.1.7.jar is necessary to copy to lib folder. It won't cause problems to existing one (newer)
  • copy context file jasperreports-example-context.xml to your extension folder
  • restart alfresco

Running test example

  • create folder TestAlfrescoJasperReports in your company home
  • upload test FTL JRXML files: datasource_itemsInDataDictionary.ftl, report_itemsInDataDictionary.jrxml
  • upload generateReport.js server-side script to alfresco and execute it
  • generated document will have timestamped name
  • alfresco JS service syntax:
  • jasperReportsHelper.generateXMLDataSourceReport( 	
    						xmlDataSourceString, 
    						xpath report query, 
    						nodeRef object of japer report document located on repository, 
    						nodeRef object of destination folder to place generated report,
    						output format ["pdf", "xls", "docx"]
    		   );

Comments

  • source files can be found on svn on this project
  • any comments and updates are welcome!
  • this was tested on Alfresco Community 3.3g
Powered by Google Project Hosting