Project

General

Profile

Feature #29578

Add functionality to sort reports in ascending or descending order generated using Reporting Engine

Added by Marek Hulán 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1823991

1. Proposed title of this feature request
- [RFE] Add functionality to sort reports in ascending or descending order generated using Reporting Engine in Red Hat Satellite 6

2. Who is the customer behind the request?

...snip...

3. What are the nature and description of the request?

- Reporting Engine was introduced from Red Hat Satellite 6.5
- https://www.redhat.com/en/blog/getting-started-satellite-65-reporting-engine
-  While generating reports in Red Hat Satellite 6 using Reporting Engine 
- (Satellite Web UI --> Monitor --> Report Template)
- There is no option to generate a report in ascending or descending order
- And the report will be generated according to registration date and time.

4. Why does the customer need this? (List the business requirements here)

- As the report is getting generated according to registration Date and Time
- This is a general request to have option to generate report in ascending or descending order

5. How would the customer like to achieve this? (List the functional requirements here)

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

- We can test it by generating a report using Reporting Engine (Satellite Web UI --> Monitor --> Report Template)

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?:

- No

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

- No. There is no timeline but it is a basic requirement.

9. Is the sales team involved in this request and do they have any additional input?

- No

10. List any affected packages or components.

11. Would the customer be able to assist in testing this functionality if implemented?

- We can test it by generating report using Reporting Engine (Satellite Web UI --> Monitor --> Report Template)

Associated revisions

Revision c0c1e744 (diff)
Added by Marek Hulán 3 months ago

Fixes #29578 - add sorting feature to reports

Reports usually generate a tabular data using the report_render
macro. There is no way to sort such output. This patch adds a new
parameter to report_render macro allowing to specify one or more
columns for sorting.

<%= report_render order: 'Name' -%>
<%= report_render order: [ 'Name', 'Age' ] -%>

Also it may be useful to reverse the order of the report. For this
purpose a second parameter was added

<%= report_render order: [ 'Name' ], :reverse_order: true -%>

Note that both can be used independently.

For unknown column, rendering error is presented calling out the values
that were not recognized. We support all headers registered using the
report_headers macro as well as names used when calling report_row
macro, as illustrated in the following example

<%- report_headers 'Name' >
<
report_row Name: 'Ares', Age: 123 -%>
<%= report_render order: 'Age' %>

The performance impact was checked. Ordering roughly doubles the raw
rendering time, meaning the time the report_render method takes. The
order reversing is nearly instant.

On report with 10_000 rows, it added 0.05s which in such
big reports is marginal thing. Usually the report spend minutes on
parsing ActiveRecord data.

History

#1 Updated by The Foreman Bot 4 months ago

  • Assignee set to Marek Hulán
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7620 added

#2 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 2.2.0 added

#3 Updated by Marek Hulán 3 months ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Tomer Brisker 3 months ago

  • Fixed in Releases 2.1.0 added
  • Fixed in Releases deleted (2.2.0)

#5 Updated by Tomer Brisker 3 months ago

  • Subject changed from Add functionality to sort reports in ascending or descending order generated using Reporting Engine in Red Hat Satellite 6 to Add functionality to sort reports in ascending or descending order generated using Reporting Engine

#6 Updated by Tomer Brisker 3 months ago

  • Category changed from Statistics to Reporting

Also available in: Atom PDF