TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 404 forks source link

Upgrading existing reports with subreports to version 7.0.0 removes all subreports instead of updating the format #447

Closed mweisshaupt1988 closed 4 months ago

mweisshaupt1988 commented 5 months ago

I'm not quite sure if this is the correct project to submit the issue, if it is wrong, please tell me where to go :)

I have tried to upgrade existing reports to the new version using the JasperStudio 7.0.0 but instead of upgrading the subreport parts, the Studio completely removes them.

Please see the following example: Example_before_upgrade.zip

And then the upgraded example: Example_after_upgrade.zip

This is the code from the old report which should have been upgraded.

<group name="cover">
    <groupHeader>
        <part uuid="7aed05b9-1301-4a53-b47e-34289560bc0c">
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
                <subreportExpression><![CDATA["Example_cover.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
        <part evaluationTime="Report" uuid="56ab525c-754f-4f48-a52c-7cc23934be3d">
            <property name="net.sf.jasperreports.bookmarks.data.source.parameter" value="REPORT_DATA_SOURCE"/>
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
                <subreportExpression><![CDATA["Example_toc.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
    </groupHeader>
    <groupFooter>
        <part uuid="88decbbe-63ad-45cc-9e03-5dadc50004d5">
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
                <subreportExpression><![CDATA["Example_backcover.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
    </groupFooter>
</group>

And this is how it looks if I create the example again with the JasperStudio in version 7.0.0. So I suspect this is what it should have been updated to:

<group name="cover">
    <groupHeader>
        <part uuid="7aed05b9-1301-4a53-b47e-34289560bc0c">
            <component kind="subreportPart">
                <expression><![CDATA["Example_cover.jasper"]]></expression>
            </component>
        </part>
        <part uuid="56ab525c-754f-4f48-a52c-7cc23934be3d" evaluationTime="Report">
            <property name="net.sf.jasperreports.bookmarks.data.source.parameter" value="REPORT_DATA_SOURCE"/>
            <component kind="subreportPart">
                <expression><![CDATA["Example_toc.jasper"]]></expression>
            </component>
        </part>
    </groupHeader>
    <groupFooter>
        <part uuid="88decbbe-63ad-45cc-9e03-5dadc50004d5">
            <component kind="subreportPart">
                <expression><![CDATA["Example_backcover.jasper"]]></expression>
            </component>
        </part>
    </groupFooter>
</group>
teodord commented 5 months ago

How did you convert the JRXML file? I used JSS CE 7 on a MacOS, opened your Example.jrxml from the "before_upgrade" zip and when I looked at its source tab, I see the new syntax and the two parts converted properly. When I save it, it has this new syntax and it appears intact.

Thank you, Teodor

mweisshaupt1988 commented 5 months ago

I have followed your comment from here: https://github.com/TIBCOSoftware/jasperreports/issues/442#issuecomment-2184710113

screenshot

I can verify that opening the file manually does work. I'll test this a bit more but since we have a lot of reports I would like to use the batch update instead.

Thank you, Martin

teodord commented 5 months ago

Can you please go to Settings/Jaspersoft Studio/Compatibility page and in the first combobox "Version", select the already existing option that says "Always use current" and hit "Apply and Close". Then try again to update your files with the right-click option.

Thank you, Teodor

mweisshaupt1988 commented 5 months ago

This indeed did the trick. Although it has been selected before, reselecting it and hitting "Apply and Close" fixed it. I was now able to convert all reports.

Thank you, Martin

C4J commented 5 months ago

This is interesting reading and has made me wonder - is it possible for JasperSoft Studio 6.x CE to co-exist on the same computer (Mac in my scenario) with JasperSoft Studio 7.x CE or do they share a common location for settings ?

mweisshaupt1988 commented 5 months ago

This is interesting reading and has made me wonder - is it possible for JasperSoft Studio 6.x CE to co-exist on the same computer (Mac in my scenario) with JasperSoft Studio 7.x CE or do they share a common location for settings ?

I can only comment with my limited knowledge but what I observed is that it creates a folder for each version below the path ~/.config/Jaspersoft Studio/ on Linux. On Mac it is a bit different, you have a Library folder in your home directory which probably contains a Jaspersoft Studio folder as well. But I can not verify that because I don't have access to a mac.

mweisshaupt1988 commented 4 months ago

From my point of view this issue can be closed. This answer solved my problem: https://github.com/TIBCOSoftware/jasperreports/issues/447#issuecomment-2188684456

maxrabbi commented 4 months ago

Hi, I just want add a couple of notes to kinda reply to some questions above:

If you are facing additional problems with the compatibility settings, please provide all the steps and current workspace status. For example if you had previously setup compatibility at workspace or project level, if you played with multiple JSS instances etc. Thanks! Regards, Massimo.