Get row that corresponds to selected variable

Stimulsoft Reports.JS discussion
Post Reply
jaqb
Posts: 23
Joined: Thu Jul 25, 2024 7:09 am

Get row that corresponds to selected variable

Post by jaqb »

Hello,
I want to select a row from the "root" table that was selected by the user via the "days" variable (the key of this variable corresponds to the "intervalIndex "field in the "root" table). Then I want to get the "start" and "end" fields from this row and put them as a parameter of the HTTP request.
How can I do this? I've attached sample report and scheme with the result I want achieve.
Attachments
TEST select.mrt
(3.02 KiB) Downloaded 80 times
select.png
select.png (103.46 KiB) Viewed 15825 times
Lech Kulikowski
Posts: 7354
Joined: Tue Mar 20, 2018 5:34 am

Re: Get row that corresponds to selected variable

Post by Lech Kulikowski »

Hello,

Sorry, we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.
jaqb
Posts: 23
Joined: Thu Jul 25, 2024 7:09 am

Re: Get row that corresponds to selected variable

Post by jaqb »

Yes, of course.
I get a list of available intervals from the server, where each interval has "start", "end", "intervalIndex" and "intervalType" fields (table "root" in the schema and the sample report). Then I want to display this list as options for the user to choose from, so I create a variable as a request from user, where each list item has the key "intervalIndex" and the label {start} " - " {end}. The user selects one item from the list and I want to get the start and end values ​​from the item they selected (for now, I only have access to the key value of the selected item, i.e. "intervalIndex".
Lech Kulikowski
Posts: 7354
Joined: Tue Mar 20, 2018 5:34 am

Re: Get row that corresponds to selected variable

Post by Lech Kulikowski »

Hello,

In your case, you can use the Substring() function:
Start date - {DateTime.Parse(Substring(days.Label, 0, 16))}
End date - {DateTime.Parse(Substring(days.Label, 19, 35))}

Thank you.
Post Reply