Based on one field in report i need to make visible/caluculate the values of other dependent textboxes.
So for this what i have done is Created a custome function.
eg: public static string Test(int idPt)
{
//Logic
if(idPdt==1)
{
textbox2.Value="test2";
textbox2.Visible=true;
}
if(idPdt==2)
{
textbox3.Value="test3";
textbox3.Visible=true;
}
else
{
textbox2.Visible=false;
textbox2.Visible=false;
}
}
But i am not able to access any of the report items in this function. when i remove static modifier for the method then all the items are accessible.
How to acheive this in Telerik Reporting?
So for this what i have done is Created a custome function.
eg: public static string Test(int idPt)
{
//Logic
if(idPdt==1)
{
textbox2.Value="test2";
textbox2.Visible=true;
}
if(idPdt==2)
{
textbox3.Value="test3";
textbox3.Visible=true;
}
else
{
textbox2.Visible=false;
textbox2.Visible=false;
}
}
But i am not able to access any of the report items in this function. when i remove static modifier for the method then all the items are accessible.
How to acheive this in Telerik Reporting?
5 Answers, 1 is accepted
0
Hi Pavan,
You do not need user functions for such simple needs - you can directly use Expressions
and to conditionally specify the value for the TextBox utilize the IIF() function or any other built in Function that works for your needs.
Additionally if you need to access a function that is not static (instance function), you could use the following expression:
"= ReportItem.Report.ItemDefinition.MyFunction(args)
where the ReportItem is the current item in which context the expression is evaluated, the Report keyword is used to get reference to the processing report and ItemDefinition gets the definition report.
All the best,
Steve
the Telerik team
You do not need user functions for such simple needs - you can directly use Expressions
and to conditionally specify the value for the TextBox utilize the IIF() function or any other built in Function that works for your needs.
Additionally if you need to access a function that is not static (instance function), you could use the following expression:
"= ReportItem.Report.ItemDefinition.MyFunction(args)
where the ReportItem is the current item in which context the expression is evaluated, the Report keyword is used to get reference to the processing report and ItemDefinition gets the definition report.
All the best,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0

David
Top achievements
Rank 1
answered on 06 Apr 2012, 05:34 PM
When a report item is not visible how to remove the white space created by it on the report?
will the solution you are suggesting automatically do it?
thanks
will the solution you are suggesting automatically do it?
thanks
0
Hello David,
This thread does not discuss the visibility of items. For more info on your inquiry, refer to Design Considerations for Report Item Layout help article.
Greetings,
Steve
the Telerik team
This thread does not discuss the visibility of items. For more info on your inquiry, refer to Design Considerations for Report Item Layout help article.
Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0

Swetha
Top achievements
Rank 1
answered on 01 Jun 2015, 05:42 PM
Telerik Team,
I have a Telerik reporting table in which each cell has a textbox which calls the static user functions to set the value for the textbox.
Sometimes I make this table invisible dynamically in code behind and so datasource is not set for that table.
Even though the table is invisible still these user functions in that table are being called which is raising an exception in my case.
Can you please tell me how to make the static user functions are not called by expression in textbox value when the table is invisible.
0
Hello Swetha,
In more recent versions of Telerik Reporting the processing of the report does not depend on the visibility of the report items. This means that all report items will be processed and their expressions will be evaluated regardless if their Visible property is set to True or False.
You can check if the call is made by a hidden report item by sending the ReportItem.Visible value to the user function arguments. Based on this value you can continue/stop any further execution of the user function code.
Regards,
Nasko
Telerik
In more recent versions of Telerik Reporting the processing of the report does not depend on the visibility of the report items. This means that all report items will be processed and their expressions will be evaluated regardless if their Visible property is set to True or False.
You can check if the call is made by a hidden report item by sending the ReportItem.Visible value to the user function arguments. Based on this value you can continue/stop any further execution of the user function code.
Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items