Hello,
I have .trdp files that have a textbox with a culture set as 'en-US' and the format for the textbox is '{0:C2}'.
There is no such change in the file.
It was rendering negative currency values properly until I updated Telerik. Reporting Nuget version from NuGet '17.2.23.1010' to '7.2.23.1114' in my .Net 7 project.
Please, guide me if I am missing something.
Hi,
Maybe you want me refer Assign connection string dynamically using report parameter and bindings - Telerik Reporting .I followed the solution, it didn't work . And then I set the 'ConnectionString' to '@ReportParameters.PFDSConnectionString', it also didn't work, even if I add the '.Value'.Pls refer the error.png
But when I set the connection string to the property 'ConnectionString' , it worked. And I tested the parameter rendering, it's also OK. Pls refer the success.png.
I think the C# code is OK. Because when I use the appsetting.json file to injec the connection string.
Set ConnectionString to 'AcosReportsConnection', It's OK too. Pls refer the appsettings.png.
Because now the connection string come from database depending on different input parameters, I need to set the connection string dynamically.
Now I am very confused.
Do you have any suggestiones? Thanks.
We have a JSON dataset (attached) where one of the nodes is a list of products. We are displaying these products in a table in the detail section. This table has the corresponding ProductList Datasource and has 3 columns: "UP", "Total", "Net UP". We obtain the "UP" and "Total" directly from the DataSource (Fields.[@UP], Fields.[@Total]). To obtain the "Net UP" we need to check all Discounts nodes in the same line that [@Type]= "Comercial" , take the [@Rate] and multiply it with the Fields.[@UP] of that line.
We are trying to do this inserting a table to which we have bound its DataSource to the Fields.Discounts.Discount field in the "Net UP" column. With this we can obtain the [@Rate] of the discount but the problem here is that we can not address the Fields.[@UP] because it is in another context.
Do you have any idea how we can achieve that?
In my PageHeader I can use the PageNumber function to display the
PageNumber grouped by any staff like "= PageNumber('headerGroup',
Fields.MyField)".
But when I try to use this Expression to Bind the
Height of the PageHeaderSection, I got Null with the above Expression
insteat of the expected PageNumber.
The Binding Code is like that:
Bindings.Add(new Binding("Height", "= IIF(PageNumber('headerGroup', Fields.MyField) = 1, '10cm', '4cm')"));
What am I doing wrong?
A Binding like
Bindings.Add(new Binding("Height", "= IIF(PageNumber = 1, '10cm', '4cm')"));
works well.
Thanks for your support.
Hello,
can I disable Expressions on a TextBox? I am using Telerik Reporting in a C# Project.
I have a TextBox in my Report that has its value set to a string in the Reports code. If the string starts with an "=", the entire string is treated as an expression and is calculated in the rendered Report. Is there a way to display the raw text in the Report TextBox with a "=" at the start and without any calculations applied?
Addind Quotation marks to the string in C# code does not seem to work, as it now adds these Quotation marks to the rendered TextBox.
Thanks.
Question Details
I have multiple expressions which redo the same calculation several times.
Part of the calculation uses an aggregated result of a field.
Is there a way to simplify and increase the maintainability of the report by creating a calculated field for a group? This field would be used multiple times in sub-groups and in the detail section.
Please note that I do not have the power to update the source code and because of this I can not create "custom functions".
I've tried to store the calculated value in an invisible text box but I can't seem to recall this value to be used in subsequent text boxes.
Very Simplified Example
Let f(x) = Avg( Field.x ) <-- How do I set this in the group header so I can reference it in the detail section?
Let textBox7.Value = "Distance From COM: " + Abs( f(x) - Field.x )
Note: If this is not possible across groups, but it is within a group please let me know. This would also greatly simplify the maintainability of my report.
Thank you for taking the time.
Hi,
I would like to use/not use a parameter as a filter depending on the user entered value. If it's 0 then I want to ignore the filter.
Here is my configuration in report designer.
Essentially I want to achieve this:
SQL if parameter aualtranpstper= 0 then
pst_yer = parameter aualtranpstyer
SQL if parameter aualtranpstper<>0
pst_yer = parameter aualtranpstyer and pst_per = parameter aualtranpstper
What should my value column in this screen look like?
I posted the same question after reading here https://www.telerik.com/forums/conditional-filtering-and-to-skip-filter-on-empty-report-parameters#205578 but thought it better to create new question.
Thanks for your help.
AW
I have a complicated expression that I'd like to set a lower bound to.
The value should never dip below 34.
The only working solution I've found is:
Let f(x) be the expression used to calculate the value.
To include a lower bound I've been doing "=IF(f(x) < 34, 34, f(x))"
This works well when f(x) is simple but this explodes in length as the length of f(x) increases.
If I wanted to also include an upper bound of 50 I would need to write the expression as
"=IF(f(x) < 34, 34 IF(f(x) > 50, 50, f(x)))"
I've tried the Min function but it just remains blank.
"=Min(Array(5,7))" does not return 5
For context here is the expression I created to calculate the proper zoom level for a static google map.
Please note that these formulas are generated by another program I created to help me manage the complex calculations I need to do. There is no way I would ever try to manage these manually. Currently, there are 30 pins being managed and my boss is thinking about increasing this to 90.
Floor(IF(LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2) < LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2), LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2), LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2)))
Which has to be reused when I need to determine the position of a pin in my report.
200+256*POW(2,(Floor(IF(LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2) < LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2), LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2), LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2)))))*(((Item(1,AllValues(Y_COORD)))+180)/360) - 256*POW(2,(Floor(IF(LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2) < LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2), LOG(((((Parameters.PixelHeight)/2-(Parameters.Buffer))*Parameters.Pi/64))/ABS((LOG((1+(SIN((Max(X_COORD))*(Parameters.Pi)/180)))/(1-(SIN((Max(X_COORD))*(Parameters.Pi)/180))))/LOG(EXP(1)))-(LOG((1+(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180)))/(1-(SIN(((Max(X_COORD)+Min(X_COORD))/2)*(Parameters.Pi)/180))))/LOG(EXP(1)))))/LOG(2), LOG(((((Parameters.PixelWidth)/2-(Parameters.Buffer))*360/256))/(Max(Y_COORD)-((Max(Y_COORD)+Min(Y_COORD))/2)))/LOG(2)))))*((((Max(Y_COORD)+Min(Y_COORD))/2)+180)/360)
I have a comma delimited string parameter that is parsed into a c# datasource method when a Telerik report gets rendered. When I pass the string as it is into the datasource, using Parameters.personId.Value it fails and I get an error. When I use the Join(",", Parameters.personId.Value) function, it only works if the string has a single value and it's not comma delimited. The moment I append another value to the string, it sends the parameter as an empty string to the datasource.
This is how my data looks like:
Telerik UI parameter:
C# DataSource definition:
Sample Parameter Value:
PersonIds: "965985,663958"
Thanks.