Variable as parameter - Descending order?

Stimulsoft Reports.NET discussion
Post Reply
JHenn
Posts: 20
Joined: Fri Jun 01, 2018 9:23 pm

Variable as parameter - Descending order?

Post by JHenn »

I have a working report with two variables as parameters: Status and YearMonth (with YearMonth dependent on Status). I would like to have the most recent YearMonth for the selected Status as the default selected value. If I could sort the variable values (which are provided by a data source column) in descending order, then I could use the 'First' option. Or, I might be able to use an expression to determine the final (or highest) value for a given status, and set that as the default selected value. But I haven't been able to figure out how to apply either of those to a variable. Any suggestions? Thank you.

(I've ensured that the data source itself is providing the values in the desired order, but the variable list seems to always go to ascending sort. Or the "sort descending" and "expression" options, I'd prefer the descending sort.)
Judy Hennessey / PrecisionBI
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Variable as parameter - Descending order?

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data which reproduces the issue for analysis, we will try to find a solution for you.

Thank you.
JHenn
Posts: 20
Joined: Fri Jun 01, 2018 9:23 pm

Re: Variable as parameter - Descending order?

Post by JHenn »

I've been trying to set this up using the data in your #Net samples.

http://dweephor.com/Stimulsoft/Orders_intParam3A.mrt

I used your Orders table and created a parameter for the Customer ID (a text field). I grouped the data presented in the report by Customer ID.

If I specify the First value, the list is presented in ascending Customer ID order, and the first is selected -- but the results actually present the first value in the data itself, which is not the same. I don't see the ALFKI orders until I click Submit. (This is especially odd because I am grouping by the Customer ID in ascending order, and if I disable the databand's filter, ALFKI is indeed first.)
Image
Image

If I instead specify a Value of BLAUS, I get the BLAUS records automatically when results are rendered. I expect that same behavior for First as well.

Image

Now, the last name in alpha order is WOLZA. Imagine that I always want to present the list in descending order, with WOLZA being the first, and automatically selected. If I have two parameter considerations, with Customer ID being the dependent parameter, I want to see whichever value is last for the first parameter value.

It seems the order is always defined as ascending, with no way to change that.

Our common reporting need is provider and posting periods (or years). We want the provider names in ascending order but the default to be the most recent time interval (for this month, 202003, 202002, 202001, 201912, etc., keeping in mind that the most recent month for a given provider might not be the current month). Apart from the First inconsistency noted above, there doesn't seem to be a way to present the parameter values in descending order (in which case the most recent is First), or to create an expression that selects the last or maximum value over a given parameter values set.
Judy Hennessey / PrecisionBI
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Variable as parameter - Descending order?

Post by Lech Kulikowski »

Hello,

Please clarify which product, designer, viewer are you use?

Thank you.
Attachments
Annotation 2020-03-26 223603.png
Annotation 2020-03-26 223603.png (29.64 KiB) Viewed 3427 times
JHenn
Posts: 20
Joined: Fri Jun 01, 2018 9:23 pm

Re: Variable as parameter - Descending order?

Post by JHenn »

The report attached earlier was created in:
Stimulsoft Designer
Version: 2019.4.1 from October 2019, WinForms

As noted earlier, using your Orders table.

My apologies for the delay in responding, and thank you for your attention.
Judy Hennessey / PrecisionBI
JHenn
Posts: 20
Joined: Fri Jun 01, 2018 9:23 pm

Re: Variable as parameter - Descending order?

Post by JHenn »

I have also created this report in your https://designer.stimulsoft.com/ environment and saved it to the cloud there, but I'm not able to save that version to my desktop to forward it.

Note that, without the filter, ALFKI appears first in the report because of the sort in the GroupHeader.

Image
Image
Image
Judy Hennessey / PrecisionBI
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Variable as parameter - Descending order?

Post by HighAley »

Hello, Judy.

We know about the issue. It's not easy to solve it.
The issue is between the sorting of the values and the selection of the first one.

At this moment, you could either disable the sorting or change the Selection.

To disable the sorting you should set the next property of the Viewer:

Code: Select all

 ParametersPanelSortDataItems="false"
Thank you.

Ticket reference: #1802
JHenn
Posts: 20
Joined: Fri Jun 01, 2018 9:23 pm

Re: Variable as parameter - Descending order?

Post by JHenn »

Thank you. In the Stimulsoft demo environment (https://designer.stimulsoft.com/), where can I go to set the ParametersPanelSortDataItems value?

(In any event, showing the parameters in non-sorted order isn't the fix or work-around that would meet our business need. We want to see either the first sorted (or last, if that could be added) value shown as both the selected and applied parameter value.)
Last edited by JHenn on Wed May 13, 2020 1:44 pm, edited 2 times in total.
Judy Hennessey / PrecisionBI
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Variable as parameter - Descending order?

Post by Lech Kulikowski »

Hello,

That option can be set from code in your web project. It is not possible to set it on the https://designer.stimulsoft.com

Thank you.
Post Reply