Jasper report execution

I’ve seen two different ways to execute a report:

1: plugins.jasperPluginRMI.jasperReport(‘Servername’,‘reportname’,‘directory’,‘output’,{reportid: servoyid});

2: var params = new java.util.HashMap()
params.put(‘reportid’, servoyid)
plugins.jasperPluginRMI.jasperReport(‘Servername’,‘reportname’,null,‘output’,params);

Is there a difference between these two? Which method do you prefer?

There’s technically no difference and both syntaxes work just fine

The first way is the new way and more easy, because you do not have to declare Java objects, but you can just use JavaScript objects.

Paul