ServiceBreez Posted January 19, 2021 Report Share Posted January 19, 2021 Is there ANYWAY possible to do grouping on a List Report datapage? Quote Link to comment Share on other sites More sharing options...
1 Aether Posted January 26, 2021 Report Share Posted January 26, 2021 Hello @ServiceBreez, Sorry for the delay, please check the steps below regarding to the 3rd suggestion: Important Field(s) to accomplish this: ID (Autonumber) GroupField (Text255) The idea here is to display the Group field in every first occurance of the group in the report, using a Calculated field and HTML. Step 1: Create a table containing the mentioned fields Step 2: Create a List DataPage and use the table. Step 3: Add a HTML Block, that will display the GroupField Like this: <h3 style="background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;"><span style="color:#FF0000;">[@field:GroupField]</span></h3> Step 4: Add a "Calculated Field" that will SELECT the minimum/first record occurance in every Group and use a CASE statement that will hide the "Grouping Label" is condition not met. Like this: CASE WHEN ( (SELECT MIN(ID) FROM TableName WHERE GroupField=target.[@field:GroupField]) = [@field:ID]) THEN '' ELSE 'none !important' END Step 5: add a Style function and use the calculated field value to hide the Grouping label in the other record that doesn't met the condition: <h3 style="background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px; display: [@calcfield:1];"><span style="color:#FF0000;">[@field:GroupField]</span></h3> Notice the "display: [@calcfield:1];" in the code. Step 6: Hide the Calculated field in the report using this code: Refer to this link: https://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-hide-fields-in-datapages/ <table style="display:none;"><tr><td> </td></tr></table> Make sure that you enclose the calculated field with the HTML Block wit hthe code: Step 7: Use the ID as the Default sort order field: You may test it out here: https://c1abv183.caspio.com/dp/482760000760c781fb574c3e98c2 I have also attached the DataPage and Dependencies for you reference. I hope this helps CaspioData_2021-Jan-26_1036.zip Quote Link to comment Share on other sites More sharing options...
0 Aether Posted January 19, 2021 Report Share Posted January 19, 2021 Hi @ServiceBreez, As I know there is no Grouping feature in the "List DataPage" in a standard way. Here's what I think you can do: Sort the records by the field you want instead, for them to be ordered: Create a multiple List DataPage that is filtered base on your Groupfield (not recommended) Or you can do a custom code(JavaScript) that display the HTML Block below in every first occurrence per/base on GroupField. (If you do this, make sure that the record is sorted as well) I hope the suggestions helps. Quote Link to comment Share on other sites More sharing options...
0 ServiceBreez Posted January 20, 2021 Author Report Share Posted January 20, 2021 Hi @WatashiwaJin - thank you for that suggestion. With regards to the multiple List Datapage, are you suggesting multiple datapages on a webpage? Or is there something actually called a multiple list datapage? It sounds like the javascript option sounds promising. I am not familiar with how to display based on every first occurrence. Is there a sample you might be able to point me too? (BTW, your creativity is amazing!) Quote Link to comment Share on other sites More sharing options...
0 Aether Posted January 21, 2021 Report Share Posted January 21, 2021 Thank you @ServiceBreez What I suggesting in the second part is "Multiple DataPage on a WebPage" (This is not recommended because it will cause you a lot of DataPage depending on your Group(s)) but if you want to do this, you need to do a seperate search and report DataPage (https://howto.caspio.com/tech-tips-and-articles/tech-parameters/how-to-separate-search-page-and-results-page-into-two-different-webpages/) and alter the system message "No Records found" so when you search for a specific group, that message won't appear in the other DataPage. Check here on how to change it:https://forums.caspio.com/topic/6769-no-records-found-message/ As for the 3rd suggestion, I was thinking that this is also possible with the use of calculated fields + HTML combination without using JavaScript. Let me try that and get back to you Quote Link to comment Share on other sites More sharing options...
0 ServiceBreez Posted January 29, 2021 Author Report Share Posted January 29, 2021 @WatashiwaJinWOW!! Thank you!!! Quote Link to comment Share on other sites More sharing options...
0 autonumber Posted January 10, 2023 Report Share Posted January 10, 2023 Hello! I have a similar workflow where I need to do grouping in list datapage and I was able to make the code shorter. HTML Block 1 <h3 style="background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px; display: [@calcfield:1];"><span style="color:#FF0000;">[@field:GroupField]</span></h3> <table style="display:none;"><tr><td> HTML Block 2 </td></tr></table> And I enclose the Calculated Field between the HTML Block 1 and 2. Quote Link to comment Share on other sites More sharing options...
Question
ServiceBreez
Is there ANYWAY possible to do grouping on a List Report datapage?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.