I want to start a JasperReport on an Windows Server and the problem is I have in the report a relative path like “styles/stylesheet.jsxml”. On Windows the server is configuring the path with backslash(“") and it is not possible to configure the path with slash(”/").
How is it possible to set the report path in the plugin settings with slash(“/”)? Because I think it should work with slashes(“/”) on Windows too.
I don’t understand the real problem. Why is it not possible to set backslashes?
For me on a windows server the directory.jasper.report in servoy-admin works like
I have a path configured in the application server (C:\Servoy\reports). This path is given to the reports by parameter $P{SUBREPORT_DIR}. In the report I include an Style Sheet with $P{SUBREPORT_DIR} + “styles/stylesheet.jsxml”. So I get an error on windows if I want to start the report cause the path is “C:\Servoy\reports\styles/stylesheet.jsxml”.
stefbrt:
I have a path configured in the application server (C:\Servoy\reports). This path is given to the reports by parameter $P{SUBREPORT_DIR}. In the report I include an Style Sheet with $P{SUBREPORT_DIR} + “styles/stylesheet.jsxml”. So I get an error on windows if I want to start the report cause the path is “C:\Servoy\reports\styles/stylesheet.jsxml”.
OK, I cannot test this now, but you can do this workaround:
var osname = application.getOSName();
if(osname == 'windows'){
var path = "C:\Servoy\reports\styles\stylesheet.jsxml"
}
else {
var path = "C:\Servoy\reports\styles/stylesheet.jsxml";
}
This is not possible cause the $P{SUPREPORT_DIR} + “styles/stylesheet.jsxml” is in the report and the code application.getOSName() only works in servoy and not in the report environment.
The only solution I have is to eliminate the subfolders!