I’m trying to use the variable: plugins.jasperPluginRMI.relativeReportsDirectory of the jasper plugin, but always return null, anyone know why not function:
// 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
Hi,
Have you set the property (plugins.jasperPluginRMI.relativeReportDirectory) to any value? Does reading that not work?
Regards,
Andrei
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
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
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
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
Did you mean if i put this code
<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
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.
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
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
You say that use the plugins.jasperPluginRMI.compileReport inside the application, no?
pentamsi:
You say that use the plugins.jasperPluginRMI.compileReport inside the application, no?
Yes, inside your Servoy application.
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?
pentamsi:
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.
And other question, what happens with the external styles? they say to me that not find the source.
pentamsi:
And other question, what happens with the external styles? they say to me that not find the source.
External styles for the report template?
Have you tried adding them in the extra directories (also a setting for this in admin page plugins section)?
Regards,
Andrei
But if the styles are in the same directory of reports i have to put the entire route to this?
pentamsi:
But if the styles are in the same directory of reports i have to put the entire route to this?
If the styles are in the same directory as the report you are running, i think you don’t have to specify anything else; they should be seen/used from there.
Regards,
Andrei
I have this structure:
reports
-styles
–styles.jrtx
-report
–report.jrxml
–report.jasper
and all is on the same folder, but different subfolders
The for instance have this in the server admin page of the plugin:
directory.jasper.report=/reports/report
directories.jasper.extra=/reports/styles