Function in a column using value from other function

Stimulsoft Reports.WEB discussion
Post Reply
Enrique
Posts: 6
Joined: Fri Jul 29, 2016 3:09 pm

Function in a column using value from other function

Post by Enrique »

Hello.

We have a report whit three columns:
The first one contains a datatable field.
In the second column we have a function that evaluates the first column and fills a value depending on the field.
In the last one we want to use a function to evaluate the second column but we don't know how to retrieve the value or to reference the previous function.

Can you help us with this topic?

Thanks in advance,
Enrique.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Function in a column using value from other function

Post by Alex K. »

Hello,

Could you explain your task in more details? If possible, please send us a test data for analysis.

Thank you.
Enrique
Posts: 6
Joined: Fri Jul 29, 2016 3:09 pm

Re: Function in a column using value from other function

Post by Enrique »

Hello.

Thanks for your answer.
In the attached report and Excel file you will find a sample situation. In the first column we have a field from the datasource and in the second a condition based on it. In the third column we want to evaluate the first condition:

Name Condition1 Condition2
{Hello} - If Name = "Hello" then "1" - If {Condition} = "1" then "Hello 1"

Regards,
Enrique.
Attachments
ReportEjemplo.mrt
Sample report
(11.18 KiB) Downloaded 280 times
Libro1.xlsx
Sample datasource
(8.64 KiB) Downloaded 229 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Function in a column using value from other function

Post by Alex K. »

Hello,

Please check the excel file, second and third columns are empty.
Also, please try to add the additional Calculated column in which set necessary condition and then use it in the report.

Thank you.
Enrique
Posts: 6
Joined: Fri Jul 29, 2016 3:09 pm

Re: Function in a column using value from other function

Post by Enrique »

Hello.

Seems that I haven't been clear. The Excel is correct, it's only a sample. In the report we have used the first column ("Name"). In the second column we have used a function:
If "Name" = "Hello" then the "Value" of the column is 1, otherwise the "Value" is 0. This function is working properly.
In other column we want to put another function to evaluate the result of the first function: If "Value" is 1 ...., otherwise ....
We don't find the way to reference the result of the first function in other one, that is the question. If its possible, can you provide us a sample?.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Function in a column using value from other function

Post by Alex K. »

Hello,

> In other column we want to put another function to evaluate the result of the first function: If "Value" is 1 ...., otherwise ...

Could you explain your issue in more details? Which another function do you mean?

Thank you.
Enrique
Posts: 6
Joined: Fri Jul 29, 2016 3:09 pm

Re: Function in a column using value from other function

Post by Enrique »

Hello.

Yes, in the first column we have a field from the Excel datasource:
{Hoja1.Name}

In the second column we have a function to evaluate the field:
{Switch(Hoja1.Name == "Hello", 1)}{Switch(Hoja1.Name != "Hello", 0)} (If Name = "Hello" the column value will be 1, otherwise will be 0

In the third we want to evaluate the resulting value of the second. Somethinjg like this:
{Switch("Column2" == "1", "True")}
but we don't find the way to reference the second column

It's now clear?. Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Function in a column using value from other function

Post by HighAley »

Hello.

It's not so easy to get data from text components. There are component on report template and on rendered report. Usually there are many instances of one component on the rendered report.
It's better to use the same expression. Or use variables to save data there.

Thank you.
Post Reply