Show different parameter text based on SQL query when parameter is visible

1 Answer 52 Views
DataSource SQL Rendering Report Designer (standalone) Report Parameters
Alexander
Top achievements
Rank 1
Veteran
Alexander asked on 18 Jun 2024, 10:34 AM

Hello everyone,

I have an issue with visibel paremter.
To be precise I have to show different texts based on the users language.
The basic process looks like this:

Client sets language parameter -> Telerik language paremeter -> SQL selects language label based on language parameter -> Result set in language label value -> language label value set in visible report parameter text

I cannot implement the language labels into the select of the report. Therefor the multilangual labels have an own query. This ml query is set into the language label parameter.

The additional step setting the result of the SQL in the language label value is necessary as the visible parameter already has an SQL source.

Follwing steps i tried:
set the sql query for the language label (Label Text parameter.txt)
set the text value of the target to the value of the parameter mentioned above (Visible Parameter.png)
use the sql query with hardcoded language as a test (SQL hardcoded language.png)
This works fine (Result hardcoded language.png)

Changing sql to language parameter (Select with parameter.png)
SQL gets a result (Result check sql with parameter.png)
Does not work in runtime (Result SQL with parameter.png)

Changing SQL to get every text label and filter in the parameter. (SQL get all labels.png)
Testing the idea, hardcode language filter in parameter (Parameter Filter.png)
Check result works (result hardcoded filter.png)

Changing to filter with parameter (Filter with parameter.png)
Result does not work (Result filter with parameter.png)

So the problem only exists if I use a parameter. Which is unavoidable as I need the language from the active user.

I know that I could hardcode it into the parameter.text with an IIF expression.
I would have to do this for every language and every label and I´d like to avoid that.

Is there any possibility to put result of an SQL query into the parameter.text when the target parmeter already has a different query and is set visibile?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Jun 2024, 03:47 PM

Hello Alexander,

Thank you for the attached screenshots and the additional information!

The only way that I can think of achieving this in the Standalone Report Designer is by having cascading report parameters - Cascade Parameters with filtering set on Report level explained - Telerik Reporting, where when the language is selected, the report will reload and the Text property of the report parameter is set from a field in their data source(e.g. =Fields.Text).

In other words, all visible report parameters have to have their own data source which returns a field with the text and that data source is filtered by the value of the language report parameter which should be the only visible report parameter that does not depend on the selection of other visible report parameters.

If other report previewing options are used, such as the report viewers, you could use their report viewer events to manually edit the text of the report parameter but unfortunately, that cannot be used in the Standalone Report Designer.

I hope that this approach will work for your needs.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
DataSource SQL Rendering Report Designer (standalone) Report Parameters
Asked by
Alexander
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Share this question
or