In the following:
- Code: Select all
var _ok = plugins.file.writeFile(_tmp_file, _binary)
the variable _tmp_file can only contain a filename and not a full path in the webclient.
So myFile.pdf is allowed, but C:\Temp\myFile.pdf isn't (it will try to save the file as C__Temp_myFile.pdf in my downloads directory)
And the line
- Code: Select all
_ok = application.showURL('file:///' + utils.stringReplace(_tmp_file, '\\', '/'), '_blank')
will only create a new browser window when it is a http:// url, but not with a file:// url
And for me this explains also the problem that I have with the Jasper Report, where when running the report in webclient, that the option 'view' is not working, because it does exactly the same.
It streams the result of the Jasper Report to the browser and it tries to open the report in a new browser window using the file:/// url
So it looks like that when you want to show a Jasoer Report into the browser, that the binary report result (result from plugins.jasperPluginRMI.runReport()) that I have to do a writeFile myself so that the report is shown in a new window.
In my opinion it looks like there is a bug in the application.showURL(url, '_blank') where this doesn't work in all cases.
Can someone from Servoy confirm this?