Bug 72391 - REPORTBUILDER: Reports with functions don't work in LO 4.2
Summary: REPORTBUILDER: Reports with functions don't work in LO 4.2
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha1
Hardware: Other All
: high critical
Assignee: Lionel Elie Mamane
URL:
Whiteboard: BSA target:4.3.0 target:4.2.0.1
Keywords: regression
Depends on:
Blocks: mab4.2
  Show dependency treegraph
 
Reported: 2013-12-06 10:51 UTC by kanyi
Modified: 2013-12-09 19:49 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
The database, where the Report builder is not working. Sorry, but I can not attach the spreadsheet. (297.77 KB, application/vnd.sun.xml.base)
2013-12-06 10:51 UTC, kanyi
Details
This is a sample spreadsheet for the database (154.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-12-07 11:43 UTC, kanyi
Details
.ods spreadsheet - auto detect (154.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-12-07 11:46 UTC, kanyi
Details
Try to open the reports. One is created in LO 4.2 - function isn't saved ... (14.78 KB, application/vnd.sun.xml.base)
2013-12-07 17:14 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kanyi 2013-12-06 10:51:55 UTC
Created attachment 90349 [details]
The database, where the Report builder is not working. Sorry, but I can not attach the spreadsheet.

Problem description: 
I can not open my reports file in the database. 

Steps to reproduce:
Try to open any reports

Current behavior:

Expected behavior:

              
Operating System: Windows 7
Version: 4.2.0.0.beta2
Comment 1 retired 2013-12-06 11:03:15 UTC
Unsure what to make of this. Trying to open any report results in LO complaining about the missing ods spreadsheed file (which is of course correct behavior).
Comment 2 Robert Großkopf 2013-12-06 15:09:32 UTC
Hi kanyi,

please create a simple database which shows the buggy behavior. A database-file without any database-table wouldn't work. Nobody could confirm the bug with such a database-file.
I have tested LO 4.2.0.0.beta2 with a database added here: https://bugs.freedesktop.org/attachment.cgi?id=90113
All reports of the database work with my system: 
OpenSUSE 12.3, 64bit rpm Linux.

Regards

Robert
Comment 3 Robinson Tryon (qubit) 2013-12-07 02:24:46 UTC
Status -> NEEDINFO for repro documents.
Comment 4 Robert Großkopf 2013-12-07 08:05:55 UTC
(In reply to comment #3)
> Status -> NEEDINFO for repro documents.

Why do you set it to NEEDINFO? Have a look in the History ( https://bugs.freedesktop.org/show_activity.cgi?id=72391 ). With NEEDINFO it is also set to "CONFIRMED = 1" . This bug has never been confirmed by any other person except the bug-reporter.
Comment 5 kanyi 2013-12-07 11:43:21 UTC
Created attachment 90402 [details]
This is a sample spreadsheet for the database

Sorry, but this is the easiest way. I attach a spreadsheet, and you connect for this. I can't create table in the database. :(
Comment 6 kanyi 2013-12-07 11:46:38 UTC
Created attachment 90403 [details]
.ods spreadsheet - auto detect
Comment 7 Robert Großkopf 2013-12-07 15:45:38 UTC
I can confirm, that all reports of this database could not be opened with LO 4.2.0.0 beta2. My system: OpenSUSE 12.3 64bit rpm Linux.
You could open the reports for editing and save them with a new name in LO 4.2.0.0 beta2. The new created reports would then work in LO 4.2.0.0 beta2 but won't work in LO 4.1.3.2. I will test a little bit more.
Comment 8 Robert Großkopf 2013-12-07 17:14:08 UTC
Created attachment 90419 [details]
Try to open the reports. One is created in LO 4.2 - function isn't saved ...

I have tried it a little bit more with many reports here. Then I recognized, that LO 4.2.0.0 beta2 couldn't execute reports, which work with a function. When you open this reports and save them with a new name the functions have been gone. The reports could then be executed with LO 4.2, but without executing a function. The new created reports couldn't executed any more with LO 4.1.3.2.
Comment 9 Robert Großkopf 2013-12-07 17:16:02 UTC
I will set the Importance to high and critical, because many reports in LO would be unusable with this version of LO.
Comment 10 Robert Großkopf 2013-12-07 18:16:47 UTC
Set the version to LO 4.2.0.0alpha1. Tested it with this version and with 4.2.0.0alpha0 form 2013-11-04. With alpha0 the reports would work. The error first appears in alpha1.
Lionel, could you please have a look at this?
Comment 11 Lionel Elie Mamane 2013-12-07 20:27:47 UTC
@noelgrandin: this comes from the commit below.

  aStr.equalsAsciiL( "%", 1 )

is NOT equivalent to

  aStr.startsWith( "%" )

but it is equivalent to

  aStr == "%"


Could you please check/correct the rest of your commit, and any similar ones? Thanks.

By contrast,

  aStr.compareToAscii( "%", 1 ) == 0

is equivalent to

  aStr.startsWith( "%" )

commit 363cc397172f2b0a94d9c4dc44fc8d95072795a3
Author: Noel Grandin <noel@peralex.com>
Date:   Tue Nov 19 12:47:37 2013 +0200

    convert equalsAsciiL calls to startWith calls where possible
    
    Simplify code like:
        aStr.equalsAsciiL( "%", 1 )
    to
        aStr.startsWith( "%" )
    
    Change-Id: Iee0e4e60b0ae6d567fa8f72db5d616fffbec3c00

diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 475c489..954bce4 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1020,7 +1020,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection)
 OUString ORptExport::convertFormula(const OUString& _sFormula)
 {
     OUString sFormula = _sFormula;
-    if ( _sFormula.equalsAsciiL("rpt:",4) )
+    if ( _sFormula.startsWith("rpt:") )
         sFormula = "";
     return sFormula;
 }
Comment 12 Commit Notification 2013-12-07 20:37:53 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eb60095292b5ef8dc94a0b166151d3a79c9df156

fdo#72391 empty formula is "rpt:", not starts with "rpt:"



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Robert Großkopf 2013-12-08 09:30:55 UTC
@Lionel,

thanks a lot. Don't know if it is the right way to put you into CC, but sometimes ...

Target is 4.3.0. I think it is 4.3.0, because it has been late yesterday. Hope it will be fixed also in 4.2.0

Regards

Robert
Comment 14 Lionel Elie Mamane 2013-12-08 10:01:11 UTC
(In reply to comment #13)

> Target is 4.3.0. I think it is 4.3.0, because it has been late yesterday.
> Hope it will be fixed also in 4.2.0

Backport of the fix to 4.2 is waiting for review in gerrit.
Comment 15 Commit Notification 2013-12-09 10:53:53 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c5b7a5fd191a8ec65a64980fe3197832dba1ffae

fix equalsAscii conversion. Noticed in fdo#72391



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2013-12-09 16:51:54 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee107cd95b4e449391da5f1fe9246682bcf1e6ce&h=libreoffice-4-2

fix equalsAscii conversion. Noticed in fdo#72391


It will be available in LibreOffice 4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2013-12-09 19:49:20 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=62b6a778ea2a2b5b4f164db284c5a2910586bfb7&h=libreoffice-4-2

fdo#72391 empty formula is "rpt:", not starts with "rpt:"


It will be available in LibreOffice 4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.