Jasper Plugin configuration in Servoy 4.1.3

Hi everybody,

I’m trying to configure Jasper Plugin. I have installed, I think, correctly the plugin. It is available in the plugins list and I can browse and use the methods. But I can’t find where you configure the Reports directory path (where the plugin looks at Jasper reports). I’ve looked in Window>Preferences but nothing.

By the way, how does it work when you install your solution on another server? Do you have to go into Developer to change the path if it’s not the same?
What is the default path of the Server (if we put a relative path)?

Also, in iReports 3.5.2 you can generate .rtf files. In Jasper Plugin this type is not mentioned, but is it possible to use it?

I’ve managed to modify the reports path by going in the admin page and changing it in the plugin page.

But now I have a new problem!

My SQL query for the report is like that:

SELECT
     tbl_proposals."fld_id" AS tbl_proposals_fld_id,
     tbl_epc."fld_parent_id" AS tbl_epc_fld_parent_id,
     tbl_epc."fld_project_description" AS tbl_epc_fld_project_description,
     tbl_epc."cal_epc_no" AS tbl_epc_cal_epc_no,
     parent.cal_epc_no AS parent_cal_epc_no
FROM
     "public"."tbl_epc" tbl_epc INNER JOIN "public"."tbl_proposals" tbl_proposals ON tbl_epc."fld_id" = tbl_proposals."fld_epc_id"
INNER JOIN tbl_epc AS parent ON tbl_epc.fld_parent_id = parent.fld_id
     
WHERE
     tbl_proposals."fld_id" = $P{Proposal_id}

My code to generate the report in my solution is like that:

function GenerateReport()
{
	var params = new java.util.HashMap();
	params.put('Proposal_id', fld_id);
	params.put('Original_PO', tbl_proposals_to_tbl_epc_orders.fld_order_no);
	params.put('Author', globals.CurrentUserName);
	params.put('Checker', v_checker);
	params.put('Approver', v_approver);
	params.put('Labour_Cost', v_labour_cost);
	params.put('Hardware_Cost', v_hw_cost);
	params.put('Site_Cost', v_site_cost);
	params.put('Total_Cost', v_total_cost);
	
	plugins.jasperPluginRMI.runReport(controller.getServerName(),'CV-Report.jrxml' ,null,'viewer',params);

All paramareters with solution variables beginning by ‘v_’ are simple form variables (like v_checker) used as dataproviders in fields to get input from the user to fill the report.

1st the report generated does not print any cost entered (type tried in iReport were ‘number’ then ‘float’, pattern ‘currency’)
However the Author and Checker fields are printed well in the report.

All fields in the solution are simple TEXT_FIELDS without any format.
I’ve tried to put back the pattern of one of the cost field in iReport, to default (nothing). I’ve saved the report, restarted Servoy, but it still display the report with the currency symbol (a ‘£’) in the field like the ones which have not been changed.

Also, the Proposal_Id passed to the report does still the same even if I change of record. It looks like it keeps the report version when I just tested it from iReport (with prompts).

Whenever using a parameter in the where clause always use the exclamation point to have it translated properly.

So this means $P!{param_name}

In your case:

WHERE
     tbl_proposals."fld_id" = $P!{Proposal_id}

Does this help?

Thx. But I still have my problem of old report version use.

I have replaced parameter field in my report by empty labels.
Saved.
Closed iReport.
Closed Developer.
Restarted Developer.
Run the solution.
Result: it generates a report with ‘null’ in the replaced fields. :shock:

Moreover it still show the details of my test record even if in Servoy console it prints the ID of the record I’ve selected in the solution! I’ve tried the same query used for the report. Replaced the parameter used (the id printed in the console) by the ID number (which should be the same) and I get the correct result with the correct details. Not what the report shows me.

As if I used an old report. :roll:

I found the problem! Fixed now :)

In fact, as I specified the .jrxml file as report template to use I expected that modifying my report and saving it would be enough. But when I have tried to delete the .jasper file and I have seen that no report was generated I understood that Servoy is using the .jasper file and not the .jrxml and I had to recompile the report each time I did modify something!

I’m too used to Eclipse :D

Works fine now. Thx

Once your jasper report works then you can use the .jaser version instead of the .jrxml version since the plugin will not have to recompile it the results should be slightly faster.
Warning:
Note that if you change the version of the iReport used to make the jrxml and the jasper type files the servoy jasperreports plugin may not be able to recompile the jrxml since it probably is using an older jar version.

You might want to check out discussions on the plugin development here:

Ok, thanks for the tips :)