Skip to content

Use post-processed query results in query exports #2814

Closed

Description

@grantfitzsimmons

image

image

query_results_2023-01-13T19 25 25.499648.csv

Plarson:

I use the audit log query to gather data for quarterly reports. The query results display nicely in SP7 but when I export the results, much of it is unreadable and I spend a lot of time doing 40-50 find/replace operations to convert table numbers to the table names so that I can see what’s been done over the last 3 months. It would be more useful to export the table names. Likewise with the actions and field names (user-created caption vs, e.g., “text1”).

Activity

  1. specifysoftware commented on Jan 13, 2023

    @specifysoftware
    Collaborator

    This issue has been mentioned on Specify Community Forum. There might be relevant details there:

    https://discourse.specifysoftware.org/t/audit-log-export-displays-query-result-values/990/3

  2. maxpatiiuk commented on Jan 13, 2023

    @maxpatiiuk
    Member

    The heading issue is fixed in #2769.

    The rest is because front-end does fancy formatting of the data it received from the back-end. The export is coming from the back-end so it shows you the raw data front-end receives.

    A possible solution would be to offload some formatting from the front-end to back-end.
    Another solution would generate csv export on the front-end (though that would only work for records that are already loaded)

  3. changed the title [-]Improve Sp Audit Log Export appearance[/-] [+]Use post-processed query results in CSV exports[/+] on Feb 7, 2023
  4. changed the title [-]Use post-processed query results in CSV exports[/-] [+]Use post-processed query results in query exports[/+] on Feb 7, 2023
  5. maxpatiiuk commented on Feb 7, 2023

    @maxpatiiuk
    Member

    This issue also manifests itself with Agent Type. See #2954

  6. maxpatiiuk commented on Mar 22, 2023

    @maxpatiiuk
    Member

    From @chanulee1:

    Agent type not displayed as expected in qcbx search results.

    mIlF2yyx5P.mp4

    https://coldfish-xml-editor.test.specifysystems.org/specify/view/collectionobject/61610/

    From @maxpatiiuk:

    This is because when the back-end does formatting, it uses pick list item value, rather than the title - not sure how simple that would be to fix (because it constructs a SQL query to do the formatting - it's very performant, but also very feature limited)

    In the preview, front-end formatting is used, which supports more features.

  7. maxpatiiuk commented on Mar 22, 2023

    @maxpatiiuk
    Member

    Related to #1144 as both concern SQL generation for formatting/aggregating

  8. maxpatiiuk commented on Mar 27, 2023

    @maxpatiiuk
    Member

    Yet another outcome of this issue:

    From @grantfitzsimmons:

    image

    This should be using the title. This is on the UWFC label in the uwfc database.

    ($F{1,9-determinations.determination.typeStatusName}==null?"":$F{1,9-determinations.determination.typeStatusName})
    image

    To make it so that I could make this string uppercase at the start, I wrote the following expression for Jaspersoft Studio:

    ($F{1,9-determinations.determination.typeStatusName}==null?"":($F{1,9-determinations.determination.typeStatusName}.substring(0,1).toUpperCase()+$F{1,9-determinations.determination.typeStatusName}.substring(1,$F{1,9-determinations.determination.typeStatusName}.length()).toLowerCase()))
  9. maxpatiiuk commented on Mar 27, 2023

    @maxpatiiuk
    Member

    Once this is fixed, front-end formatting of query results can be removed (which would also result in slight performance improvements)

  10. grantfitzsimmons commented on Jun 21, 2023

    @grantfitzsimmons
    MemberAuthor

    This has come up again with Willem at SAIAB.

    For reference, here are the numbers for each action in the SpAuditLog:

    ID Action
    0 Create
    1 Update
    2 Delete
    3 Merge
    4 Move
    5 Synonymize
    6 Desynonymize
  11. maxpatiiuk commented on Jun 29, 2023

    @maxpatiiuk
    Member

    Partial work-around:
    Caroline added ability to export only selected rows.
    That export is done on the front-end - and if I remember correctly, it is done on the formatted data (or if not, won't be hard to change it to work on formatted data)

  12. added
    2 - QueriesIssues that are related to the query builder or queries in general
    and removed on Jul 2, 2023
  13. grantfitzsimmons commented on Jun 17, 2024

    @grantfitzsimmons
    MemberAuthor

    From Garth at The University of Michigan:

    We are observing an issue in how picklists are handled in labels & reports in the herbarium database in Specify 7. This issue is confined to pick list fields, as displayed in Specify 7. Specify 6 is displaying as intended.

    Picklist values are being displayed in Specify 7 output, whereas picket titles are displayed in Specify 6. Here's an example of the reports output and the underlying xml report code.

  14. locked and limited conversation to collaborators on Dec 20, 2024
  15. converted this issue into a discussion #5713 on Dec 20, 2024
  16. moved this from 📋 Backlog to ✅ Done in Back-End Backlogon Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1 - RequestA request made by a member of the community2 - QueriesIssues that are related to the query builder or queries in generalSeparationFrom6

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions