Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049119Openbravo ERPA. Platformpublic2022-04-25 11:592022-05-06 00:21
gorkaion 
Triage Platform Base 
highmajoralways
closedfixed 
5
 
PR22Q3 
Core
No
0049119: Redundant PDF generation printing documents with multiple selection
Reviewing a performance problem while printing invoices using the toolbar standard print button I have noticed that each selected invoice is generated individually and later a bigger pdf with all invoices.

The individual PDFs consume a lot of time to generate but are discarded since the jasperPrint object is used to generate the complete pdf.
1. Go to Sales Invoice window.
2. Select several invoices.
3. Click on the Print button and select the just print option.
3. Check in the attachments tmp folder that a PDF is generated for each selected invoice.
4. Later a single PDF containing all the invoices is downloaded.
5. Finally all the PDFs are removed.
Remove the call to saveTempReport on PrintController

https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java#L245 [^]

This call is not needed at all since the printReports method is using the jrPrintReports Collection uses the jasperPrint objects generated for each invoice in the line 236.

By removing this line the time to generate the full PDF is reduced to almost half the time.

No tags attached.
Issue History
2022-04-25 11:59gorkaionNew Issue
2022-04-25 11:59gorkaionAssigned To => Triage Platform Base
2022-04-25 11:59gorkaionModules => Core
2022-04-25 11:59gorkaionTriggers an Emergency Pack => No
2022-04-28 11:05martinsdanIssue Monitored: martinsdan
2022-04-28 18:07hgbotNote Added: 0136840
2022-05-06 00:21hgbotResolutionopen => fixed
2022-05-06 00:21hgbotStatusnew => closed
2022-05-06 00:21hgbotNote Added: 0136996
2022-05-06 00:21hgbotFixed in Version => PR22Q3
2022-05-06 00:21hgbotNote Added: 0136997

Notes
(0136840)
hgbot   
2022-04-28 18:07   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/579 [^]
(0136996)
hgbot   
2022-05-06 00:21   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/579 [^]
(0136997)
hgbot   
2022-05-06 00:21   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 0dc2e4bbf07a444740a72239b7160244480d59e5
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 06-05-2022 00:20:36
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/0dc2e4bbf07a444740a72239b7160244480d59e5 [^]

Fixes ISSUE-49119: Prevents unneded pdf generation when printing multiple documents

When several records are selected and then clicking on the Print toolbar button, a single document is download,
and each document is attached to the records it belongs to if that option is chosen. During that process a copy of
each report is being stored in a temporary file, but apparently then that copy is not used.

Skipping the creation of those copies will save quite some time (50% estimated)

---
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
---