Defect #492
odd compile problem
100%
Description
When trying to compile a report using the plugin something strange happens:
Whenever the name of the file (without extension) doesn't match the name property in the jasperReport tag of the jrxml file, the file won't compile.
Most annoying is the plugin returning 'true' as a result.
I don't know how this did happen, but as I need to recompile a lot of reports, it would be nice if this could be fixed.
When compiling the report through iReport, the .jasper file is created without any problem.
Files
History
Updated by Andrei Costache over 12 years ago
- Status changed from New to In Progress
- Assignee set to Andrei Costache
Updated by Andrei Costache over 12 years ago
Marc,
I cannot reproduce this with Servoy 5.2.13 and the 3.3.0 (final) version of the plugin.
Neither with Servoy 6.0.7 and 3.3/4.0b versions of the plugin.
Is this still reproducible on your side?
Regards,
Andrei
Updated by Marc Boegem over 12 years ago
Hi Andrei,
sorry for the late reply.
Tried to compile this situation in 3.3.0b1 as well as 3.3.0 final, but both situations fail.
So: yes, it's still reproducible.
To clarify things:
Let's say I have a report file 'myReport.jrxml', then the first line normally is something like:
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="myReport" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
Now if someone changes the name 'myReport.jrxml' on the filesystem to: 'yourReport.jrxml', the first line of the jrxml file will still have a property name="myReport".
To test this I don't do anything special, just call the compile function:
plugins.jasperPluginRMI.compileReport('yourReport.jrxml');
Updated by Andrei Costache over 12 years ago
Marc,
I should have asked this earlier, but what is the scripting language of your report? Do you get any errors in the servoy_log (if yes, please post them)?
Regards,
Andrei
Updated by Andrei Costache over 12 years ago
Also, what iReport are you using? If you are using an iReport version, that has a bundled jasperreports version, higher than the jasperreports version the plugin comes along with, you might run into issues.
For instance, if you are using the 3.3 version of the plugin, designing with iReport 4.6 and then trying your above scenario, you will most probably run into issues (as there is a known issue with iReport which is described here: http://jasperforge.org/plugins/mantis/view.php?id=5784).
Regards,
Andrei
Updated by Marc Boegem over 12 years ago
- File sample.zip sample.zip added
Andrei,
scripting language is Groovy and iReport version is 4.5.1
But these just don't have anything to do with this issue.
I have created a sample solution now including 2 reports:
myReport.jrxml which has a name property 'myReport'
yourReport.jrxml which has also a name property 'myReport'
myReport will succesfull compile and create the .jasper file
yourReport will not compile (although the plugin reports 'true')
All files are in the sample.zip
Updated by Andrei Costache over 12 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
Hi Marc,
Thank you for your sample; i still was not able to fully reproduce your bug, as for me, using Servoy 5.2.13 and plugin version 3.3 (final), i only got compile errors related to groovy (and an error dialog) and no status for the compile function.
However, testing with a fix included just several hours ago, today, in the plugin code, for (also) a compilation related issue (https://www.servoyforge.net/issues/416), the bug appears to have been fixed. Now compilation will seems to run fine.
Please note that now, the compiled report will be named with the name provided in the xml attribute value, not the file name on the file system; so, as in your sample solution, be careful when you do that search over getReports() for the compiled file.
Regards,
Andrei
Updated by Marc Boegem over 12 years ago
Andrei Costache wrote:
Please note that now, the compiled report will be named with the name provided in the xml attribute value, not the file name on the file system; so, as in your sample solution
Is this also the case when you pass the destination via the plugins compile function?
That'd be a very strange situation.
Anyway it would be nice if the same 'compile rules' apply to the plugin as in iReport.
so without destination it'll be jrxml-filename.jasper
with destination, use that filename
Updated by Andrei Costache over 12 years ago
Marc, I should have not used the word "now" in my previous post, in your quoted paragraph; i guess it's a bit misleading :).
There have been no changes related to the compile output behavior. So, the function will behave just as it did before:
- if you do not supply a destination file name, it will output relative to the jrxml (xml) name attribute value; this is default jasper reports behavior, we don't do anything special here
- if you supply a destination file name, it will use that
Hope this clarifies things - the compile function should behave as it did in a successful scenario before. The changes done for the fix previously mentioned (issue 416) are class loader context related.
Regards,
Andrei