Bug 11679 - Add an ods export choice for reports
Summary: Add an ods export choice for reports
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 12622 21560
  Show dependency treegraph
 
Reported: 2014-02-04 14:14 UTC by Jonathan Druart
Modified: 2018-10-12 12:08 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11679: Add ods as a format for reports (4.16 KB, patch)
2014-02-04 14:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: Add ods as a format for reports (5.09 KB, patch)
2014-02-05 12:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: FIX encoding in CSV file (1.76 KB, patch)
2014-02-26 12:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: Add ods as a format for reports (5.15 KB, patch)
2014-03-13 09:50 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11679: FIX encoding in CSV file (1.81 KB, patch)
2014-03-13 09:50 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11679: Add ods as a format for reports (5.26 KB, patch)
2014-03-17 08:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: FIX encoding in CSV file (1.81 KB, patch)
2014-03-17 08:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 11679: Add ods as a format for reports (5.55 KB, patch)
2014-04-27 15:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11679: FIX encoding in CSV file (1.88 KB, patch)
2014-04-27 16:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 11679: Add ods as a format for reports (6.84 KB, patch)
2014-04-28 14:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: Add the new dependency OpenOffice::OODoc (764 bytes, patch)
2014-04-28 14:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11679: Add the new dependency OpenOffice::OODoc (765 bytes, patch)
2014-04-28 15:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 11679: Add the new dependency OpenOffice::OODoc (1000 bytes, patch)
2014-04-28 15:29 UTC, Marc Véron
Details | Diff | Splinter Review
[Signed-off] Bug 11679: Add ods as a format for reports (7.08 KB, patch)
2014-04-28 15:41 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 11679: Add the new dependency OpenOffice::OODoc (1.03 KB, patch)
2014-04-28 18:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11679: Add ods as a format for reports (7.33 KB, patch)
2014-04-28 18:27 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-02-04 14:14:03 UTC

    
Comment 1 Jonathan Druart 2014-02-04 14:17:47 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2014-02-05 12:11:08 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-02-26 12:19:15 UTC Comment hidden (obsolete)
Comment 4 Aurélie Fichot 2014-03-13 09:48:19 UTC
After installing csv2ods (thanks Fridolyn), we are able to generate en ods file from a report result (utf8 OK).
Now we have the third choice "Open Document Spreadsheet" in the drop-down menu.
Comment 5 Biblibre Sandboxes 2014-03-13 09:50:07 UTC
Patch tested with a sandbox, by Aurelie Fichot <aurelie.fichot@iepg.fr>
Comment 6 Biblibre Sandboxes 2014-03-13 09:50:36 UTC Comment hidden (obsolete)
Comment 7 Biblibre Sandboxes 2014-03-13 09:50:39 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2014-03-14 13:46:44 UTC
Sorry, I can't find the instructions on installing csv2ods on the other bug mentioned. I know that we can export the sql frameworks as Libre Office spreadsheets already, but I am not sure how it is done.
Comment 9 Jonathan Druart 2014-03-17 08:31:21 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2014-03-17 08:31:26 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2014-03-17 08:32:13 UTC
(In reply to Katrin Fischer from comment #8)
> Sorry, I can't find the instructions on installing csv2ods on the other bug
> mentioned. I know that we can export the sql frameworks as Libre Office
> spreadsheets already, but I am not sure how it is done.

Sorry, I added the installation instructions in this commit message.
Comment 12 Katrin Fischer 2014-03-17 09:18:18 UTC
I like the possibility and idea of this and would love an Excel export as well, as our libraries are mostly using Windows and Office. I am a bit worried about adding a non-perl library, that needs to be installed via git - could there be a way around this? Or could you explain why this route was chosen?
Comment 13 Jonathan Druart 2014-03-17 10:41:04 UTC
(In reply to Katrin Fischer from comment #12)
> I like the possibility and idea of this and would love an Excel export as
> well, as our libraries are mostly using Windows and Office. I am a bit
> worried about adding a non-perl library, that needs to be installed via git
> - could there be a way around this? Or could you explain why this route was
> chosen?

The answer is simple: I did not find something else (in the debian packages or cpan) to do the same job :)
Comment 14 Katrin Fischer 2014-04-27 15:57:56 UTC
Still not so happy about the Python dependency... but
- this won't get into the way if you haven't installed it
- no regressions found with existing export options

I am going to pass it, as it works nicely. Leaving final decision to RM.
Comment 15 Katrin Fischer 2014-04-27 15:58:37 UTC Comment hidden (obsolete)
Comment 16 Katrin Fischer 2014-04-27 16:01:23 UTC Comment hidden (obsolete)
Comment 17 Galen Charlton 2014-04-27 22:01:55 UTC
(In reply to Katrin Fischer from comment #14)
> Still not so happy about the Python dependency... but
> - this won't get into the way if you haven't installed it
> - no regressions found with existing export options
> 
> I am going to pass it, as it works nicely. Leaving final decision to RM.

And my decision is this: given that LibreOffice and friends can readily import CSV files, I am reluctant to add something that

- requires a Python library that is not packaged for Debian
- requires direct execution by the webserver of a non-core utility, which opens Koha up to the potential for an attack via an untrusted executable called csv2ods getting onto the system PATH.

I'm especially reluctant to do so in the face of the existence of two alternatives for creating ODS files:

[1] Extending the code in C4::ImportExportFramework
[2] The existence of the OpenOffice::OODoc Perl module.
Comment 18 Jonathan Druart 2014-04-28 14:51:38 UTC Comment hidden (obsolete)
Comment 19 Jonathan Druart 2014-04-28 14:51:43 UTC Comment hidden (obsolete)
Comment 20 Jonathan Druart 2014-04-28 14:52:49 UTC
(In reply to Galen Charlton from comment #17)
> [2] The existence of the OpenOffice::OODoc Perl module.

I rewrote this patch using the OpenOffice::OODoc module.

Switch back to needs signoff.
Comment 21 Marc Véron 2014-04-28 15:15:13 UTC
Crash: syntax error at /usr/share/kohaclone/C4/Installer/PerlDependencies.pm line 710, near "min_ver"

Error in 2nd patch (near "required"):

    'OpenOffice::OODoc' => {
        usage      => 'Export',
        required   => 1
        min_ver    => '2.125',
    },

Should read:

    'OpenOffice::OODoc' => {
        usage      => 'Export',
        required   => '1',
        min_ver    => '2.125',
    },
Comment 22 Jonathan Druart 2014-04-28 15:18:57 UTC Comment hidden (obsolete)
Comment 23 Jonathan Druart 2014-04-28 15:19:35 UTC
(In reply to Marc Véron from comment #21)
> Crash: syntax error at /usr/share/kohaclone/C4/Installer/PerlDependencies.pm
> line 710, near "min_ver"

Aarg, sorry. Thanks for the catch!
Comment 24 Marc Véron 2014-04-28 15:29:32 UTC Comment hidden (obsolete)
Comment 25 Marc Véron 2014-04-28 15:41:09 UTC Comment hidden (obsolete)
Comment 26 Galen Charlton 2014-04-28 15:54:53 UTC
(In reply to Jonathan Druart from comment #20)
> (In reply to Galen Charlton from comment #17)
> > [2] The existence of the OpenOffice::OODoc Perl module.
> 
> I rewrote this patch using the OpenOffice::OODoc module.

Thank you, I really appreciate your doing this.
Comment 27 Katrin Fischer 2014-04-28 18:27:02 UTC
Created attachment 27741 [details] [review]
[PASSED QA] Bug 11679: Add the new dependency OpenOffice::OODoc

How I tested: Apply patch, verify that dependency shows
up in About Koha->Perl Mudules
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 28 Katrin Fischer 2014-04-28 18:27:14 UTC
Created attachment 27742 [details] [review]
[PASSED QA] Bug 11679: Add ods as a format for reports

This patch adds the ability to export the data generated by a report
into a ods file.

Test plan:
1/ Install the new dependency
2/ Verify you are able to generate an ods file from a
report result.

Tested with several reports and downloaded them as Open Document
Spreadsheet. Wors as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Verified tab and comma separated export still works correctly.
Verifid new ODS export works nicely.
Tested with data containing Arabic characters and German umlauts.
Comment 29 Galen Charlton 2014-04-28 19:07:14 UTC
Pushed to master.  Thanks, Jonathan!