logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Ott  
#1 Posted : Wednesday, March 16, 2022 2:56:20 PM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
Hello,

Are there options available to turn a report like this:

Incident# Reported Date Incident Type Office Code Count of Office Code
22034423 3/15/2022 INFO MAIN 1
22034438 3/15/2022 PS MAIN 1
22034352 3/15/2022 MSEIZ MAIN 1
22034082 3/15/2022 ALRMS MAIN 1
22034412 3/15/2022 PS MAIN 1
22034183 3/15/2022 MEDIC MAIN 1
22034364 3/15/2022 INFO MAIN 1
22034156 3/15/2022 MEDIC MAIN 1
Subtotal 8
22034184 3/15/2022 DOA OTH 1
Subtotal 1
22034131 3/15/2022 PS REM 1
22034305 3/15/2022 PS REM 1
22034136 3/15/2022 PS REM 1
22034125 3/15/2022 PS REM 1
22034228 3/15/2022 PS REM 1
22034249 3/15/2022 PS REM 1
Subtotal 6



Into a report where the sorted values (Office Code) are only displayed when the values change instead of displaying all values?

Incident# Reported Date Incident Type Office Code Count of Office Code
22034423 3/15/2022 INFO MAIN 1
22034438 3/15/2022 PS 1
22034352 3/15/2022 MSEIZ 1
22034082 3/15/2022 ALRMS 1
22034412 3/15/2022 PS 1
22034183 3/15/2022 MEDIC 1
22034364 3/15/2022 INFO 1
22034156 3/15/2022 MEDIC 1
Subtotal 8
22034184 3/15/2022 DOA OTH 1
Subtotal 1
22034131 3/15/2022 PS REM 1
22034305 3/15/2022 PS 1
22034136 3/15/2022 PS 1
22034125 3/15/2022 PS 1
22034228 3/15/2022 PS 1
22034249 3/15/2022 PS 1
Subtotal 6


epf  
#2 Posted : Thursday, March 17, 2022 1:59:30 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
there is no simple option to do that (could be a feature request).
to achieve this, you should write some specific code in a task to modify you model result (check sample 503-Final Script - Change result table.srex)
Ott  
#3 Posted : Thursday, March 17, 2022 2:14:02 PM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
It would be better handled as a new feature since our users create their own reports dynamically using the Web Designer. How should I go about to make a new feature request?

Yves
epf  
#4 Posted : Friday, March 18, 2022 8:28:02 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Yes, it was already mentioned in the TODO list but was not really a priority, I just update the TODO list again...
Note that you may always sponsor a new feature to make sure to have in in a future release.

epf  
#5 Posted : Friday, March 18, 2022 4:07:24 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Here is a Task sample to do what you want for SubTotals columns.
The task must be executed at the 'Before rendering' step.

Please check if it works and we may consider to add a flag in the element to make it standard...

Code:
@using System.Data
@{
    ReportTask task = Model;
    Report report = task.Report;   
    foreach (var model in report.Models) 
    {
        foreach (var page in model.Pages) 
        {
            var dataTable = page.DataTable;
            foreach (var line in page.DataTable.Lines) 
            {
                int i = dataTable.BodyStartRow, cols = dataTable.ColumnCount;
                string[] lastValues = new string[dataTable.ColumnCount];
                for (int j = 0; j < cols; j++)
                {
                    //init first values
                    var cell = dataTable[i, j];
                    if (cell.Element != null && cell.Element.ShowSubTotals) {
                       lastValues[j] = cell.DisplayValue;
                    }
                }
                i++;
                
                while (i < dataTable.BodyEndRow)
                {
                    string currentValue = "";
                    for (int j = 0; j < cols; j++)
                    {
                        var cell = dataTable[i, j];
                        if (cell.Element != null && cell.Element.ShowSubTotals) {
                            if (lastValues[j] == cell.DisplayValue) {
                                cell.Value = "";
                             }
                             else {
                                lastValues[j] = cell.DisplayValue;
                             }
                        }
                    }
                    i++;
                }
           }
        }
    }
}
Ott  
#6 Posted : Friday, March 18, 2022 5:19:28 PM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
I'm not sure I understand where this script could be added, I can't find a 'Before rendering' stop anywhere.
epf  
#7 Posted : Saturday, March 19, 2022 7:14:30 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Actually it is the task 'Execution Step' : Models generated, before rendering.

I just added this as a standard option in the incoming 6.6 version.

Edited by user Friday, March 25, 2022 3:45:17 PM(UTC)  | Reason: Not specified

Ott  
#8 Posted : Monday, March 28, 2022 1:04:33 PM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
I found the task "'Execution Step' : Models generated, before rendering" in the 'fat client' Report Designer, but not in the Web Report Designer. I added the script you provided to the report definition using the 'fat client' and saved the report definition. It did not make a difference when I executed the report from the Web Report server. Hopefully, the feature you added in Ver. 6.6 will do the trick.

Yves
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.