Defining DB2 Datasource in struts.xml while writing query in .jrxml file

Hi, 

I am writing the following query in my .jrxml file(using the created db2 repository for db connectivity) and the report is generated successfully in jasper studio But i want to generate the same report from my jsp page and in the back end the values(table values) might change, so the report should be generated accordingly. What should the datasource be in such a case ?

In my departments.jrxml file

 

<property name="com.jaspersoft.studio.data.defaultdataadapter" value="JasperDB"></property>
<querystring></querystring>
<!--[CDATA[SELECT DEPARTMENT.DEPARTMENT_NAME, DEPARTMENT.NO_OF_EMPLOYEES FROM EEMS.DEPARTMENT AS DEPARTMENT]]>

In action class:

try {
 JasperCompileManager.compileReportToFile(
          "D:/EmployeeExpense/eems/WebContent/users.jrxml",
          "D:/EmployeeExpense/eems/WebContent/users.jasper");

 

In struts.xml

 

<action class="com.eems.action.PieAction" name="pie"></action>
<result name="success" type="jasper"></result>
<param name="location">/jasper/departments.jasper</param>
<param name="dataSource">JasperDB</param>
//JasperDB is the name of the repository
Attachments: 
rishirich_6's picture
Joined: Jul 31 2012 - 5:21am
Last seen: 10 years 6 months ago

0 Answers:

No answers yet
Feedback
randomness