Problem with plugins.jasperPluginRMI.relativeReportsDirector

Questions and answers on developing, deploying and using plugins and JavaBeans

Problem with plugins.jasperPluginRMI.relativeReportsDirector

Postby pentamsi » Tue Dec 18, 2012 3:53 pm

I'm trying to use the variable: plugins.jasperPluginRMI.relativeReportsDirectory of the jasper plugin, but always return null, anyone know why not function:

Code: Select all
// By default the value is read from the adim page Server Plugins, the directory.jasper.report property.
//A client is only able to set a path relative to the server report directory.
//If the client modifies this property, its value will be used instead of the default one, for the whole client session and only for this client.
//Each client session has it's own relativeReportDirectory value.


this is the description
Last edited by pentamsi on Tue Dec 18, 2012 5:57 pm, edited 1 time in total.
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Tue Dec 18, 2012 5:31 pm

Hi,

Have you set the property (plugins.jasperPluginRMI.relativeReportDirectory) to any value? Does reading that not work?

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Tue Dec 18, 2012 5:58 pm

No, but the description of the property say that if you don't put anything get automatically the directory.jasper.report directory, and I'm surte that i filled
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 12:01 am

If you do not put anything in for the relativeReportsDirectory, the plugin will use your server-side setting, but you will not be provided with the value of that setting on a client, i.e. the plugin will not tell the absolute directory path set in that admin page property if you print out the relative directory prop - because you have actually not set it.
Why do you need the value of the sever side setting on the client?

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 11:04 am

Because i have some subreports in the reports, and seems the jasper search this subretports in local, and i make a method to download the reports in the client side, because when go to find some report referencied by the principal report, don't find anything because search with the route of the server in the local client. I don't know if i explain so good, or you need some example
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 11:22 am

The client side relative path setting will tell the plugin to look for the requested resource on the server absolute path + client side relative path on the server, so not on the client. For instance, if you have the server side property set like "jasper.report.directory=/parent" and in the client you set "plugins.jasperPluginRMI.relativeReportsDirectory='/child1'", then when you do runReport, the plugin will know to look on the server in the "/parent/child1" directory.

If you use subreports (i think there was a similar topic some time ago) in foundset based reports i suppose and you also need to look in some subdirectory of the reports directory, then you can use the setting as described above and also the com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadReport('subreport.jasper') as described in the plugin wiki.

Hope this helps,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 12:05 pm

Did you mean if i put this code
Code: Select all
<subreport>
   <dataSourceExpression><![CDATA[$F{customers_to_orders}]]></dataSourceExpression>
   <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadReport($P{SUBREPORT_DIR} + "subreport1_fs.jasper")]]></subreportExpression>
</subreport>


in each report, the main report search the subreports in the server instead in the client side?

But, when i put the line in the report say me an error
Attachments
Captura de pantalla 2012-12-19 a la(s) 11.20.50.png
Captura de pantalla 2012-12-19 a la(s) 11.20.50.png (24.69 KiB) Viewed 8148 times
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 12:28 pm

That is because you compile with iReport; if really want to do that, maybe you could add the servoy_jasperreports.jar to your classpath.
But you can also use the plugin's compile report function; it is safer that way.
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 12:40 pm

Now i add the .jar to the classpath and show me this error:

Unable to locate the subreport with expression: "com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadReport($P{SUBREPORT_DIR} + "qcinst/ensayosStd/ensayosStdDetalle.jasper")".

any idea? It's interesting to work fine with iReports because is the tool we use to elaborate reports, and after testing we know if have so many errors. Thanks for all the help
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 12:46 pm

That is a problem with iReport and the expression evalution; not so sure that is possible to fix. But have you tried the report generation in this case (using the directory settting + this function as recommended above)?

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 12:53 pm

You say that use the plugins.jasperPluginRMI.compileReport inside the application, no?
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 1:07 pm

pentamsi wrote:You say that use the plugins.jasperPluginRMI.compileReport inside the application, no?

Yes, inside your Servoy application.
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 2:04 pm

Okey, but if i compile with the iReport and whot the warning, are any problem if i upload the .jasper to the server? the reports run fine?
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby Andrei Costache » Wed Dec 19, 2012 2:11 pm

pentamsi wrote:Okey, but if i compile with the iReport and whot the warning, are any problem if i upload the .jasper to the server? the reports run fine?

If the only warning in your report is that you use the loadReport method of the plugin, that should be just fine.
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: Problem with plugins.jasperPluginRMI.relativeReportsDire

Postby pentamsi » Wed Dec 19, 2012 2:15 pm

And other question, what happens with the external styles? they say to me that not find the source.
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Next

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 26 guests

cron