Event Reports download only downloads first page

Hi All,
I’m experiencing some problems in Event reports. On version 2.35.10.

We have an Event Report with 6 pages of data, and I get various different errors when trying to download the data from the report.

Here is what happens with every download option:

Download > Table Layout: Microsoft Excel: Error “This site can’t be reached” ERR_INVALID_RESPONSE
Download > Table Layout:CSV: Error “This site can’t be reached” ERR_INVALID_RESPONSE
Download > Table Layout: HTML: Internal Server Error 500
Download > JSON/XML/Excel/CSV: These all download, but they have Page Size=100 and Page=1, so they just download the first 100 rows. Also, if you select “Name” it still downloads the code for Data Elements with an Option Set rather than the Name.
Download >Advanced: Data Value Sets JSON/XML and Other Formats Raw SQL. I get errors for all three of these as well, stating that one of my TEAs in the table is not a valid dimension.
Download >Advanced: Other Formats JRXML: This doesn’t give me an error, but is not a helpful format for most of the end users of my system. It also implements paging.

The best way I am able to get around this is to choose the JSON option, modify the paging part of the url, then change the extension to CSV to download. However, this doesn’t fix the issue that the “code” shows up in the download instead of the “name”. The query already contains outputIdScheme=NAME, however it doesn’t seem to work.

I have a few questions here…

*Is the download of only 100 records at a time through the download feature intentional? This makes it really difficult for us as we work with large amounts of data, especially in Tracker.
*Does anyone have ideas on a good point-and-click way of getting around this; for end users who don’t have API experience?
*Is there any documentation of these bugs elsewhere? I was unable to find any…

Thanks!
Kayla

Hi @kstankevitz,
Thank you for posting this to the community, if anyone else faces the same issue, I hope they post as well; however, I tried to replicate this on play version 2.35.11 but all the files downloaded successfully:

This seems like an internal issue, maybe with your internet connection “Internal Server Error” so please try to get more details why there’s an internal server error. Try a faster internet connection? Did you try to download a similar file size report from one of the other apps?

Please share the steps to reproduce on https://play.dhis2.org/2.35.13/ I am not able to reproduce this issue but if you can reproduce this issue please create a jira bug issue in play.dhis2.org

By default it shows a 100 item and downloads the 100 items you are viewing; however, you can change these parameters: pageSize=100 and page=
Be cautious with downloading too many at a time because maybe that’s what’s causing the server errors you see above.

Yes, hopefully you’re able to get the result by changing paging on the request, but if you’d like more info you can check out the docs: https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-master/metadata-gist.html#gist_parameters_page
And always feel free to post back to the community!

Yes, I’m not sure these are bugs. We need to debug this more to understand so it’d help if you are able to reproduce them on play (and if you do then please share the steps!)

Thank you! (:

I figured it out… this was a weird one. It seems to be related to having a DE or TEA in the Event Report with a confused sort order. My “Sex” TEA was using this option set (see below). If you look at the sort order its missing #1 and starts at #4 for some reason. When I try to download an event report with this TEA I get the above errors.

If I sort the option set by code, I am immediately able to download the event report without a problem (and the order is fixed, as seen below).

image

What I haven’t determined is what caused these option sets to have non-logical sortOrder in the first place… but I will sort all option sets in the system and then it should be resolved.

2 Likes

Thank you so much for post back to the community with the solution! We need to check if the sortOrder is an issue in other instances so as to know whether it’s a bug or not, thanks!

Update:
I’m trying the api request on 2.37 and the sortOrder seems fine: https://play.dhis2.org/2.37.6/api/options?fields=optionSet[id,name,options[code,name,sortOrder]]

And in 2.35 it’s working fine except for ENTO option sets they seem to start counting from 13 but that seems like those weren’t configured properly, maybe? /api/options?fields=optionSet[id,name,options[code,name,sortOrder]]

Thanks!

1 Like