Hi,
I'm trying to use a custom function in my expression to decide what field should be displayed in the textbox, what grouping should be done, what formatting style should be applied, visibility and how the drilldown functions work.
So far I got here (example of displaying text)
C#
My expression:
= GroupDisplay(1, Parameters, Fields.TxTicket_CenterKey, Fields.TxTicket_UserKey_BilledByKey, NULL, Fields.TxTicket_BillDT)
The reason why I am using the
Am I using a bad approach to solve this or is it something that is not possible in the current release of Telerik Reporting
Kind regards,
Frank
I'm trying to use a custom function in my expression to decide what field should be displayed in the textbox, what grouping should be done, what formatting style should be applied, visibility and how the drilldown functions work.
So far I got here (example of displaying text)
C#
public
static
string
GroupDisplay(
int
GroupNumber, Telerik.Reporting.ReportParameterCollection parameters,
decimal
? RecordCenterKey,
decimal
? RecordUserKey, DateTime? BillDT_DateTime,
decimal
BillDT) {
switch
(GetGroupingForGroupNumber(GroupNumber)) {
case
ReportGrouping.None:
return
string
.Empty;
case
ReportGrouping.Centers:
return
CenterName(GetCenterKeyFromParameters(parameters), RecordCenterKey, GetViewSubCentersFromParameters(parameters));
case
ReportGrouping.Users:
return
CreateUserName(RecordUserKey);
case
ReportGrouping.Date:
return
CheckDate(GroupDate(BillDT_DateTime, BillDT));
default
:
return
string
.Empty;
}
}
My expression:
= GroupDisplay(1, Parameters, Fields.TxTicket_CenterKey, Fields.TxTicket_UserKey_BilledByKey, NULL, Fields.TxTicket_BillDT)
The reason why I am using the
Telerik.Reporting.ReportParameterCollection
instead of using every parameter separately is because there are 7 default parameters and many optional depending on the report, I want to use the same expression in all 40 so if something changes I can change the expressions in code for all of them in no time.Am I using a bad approach to solve this or is it something that is not possible in the current release of Telerik Reporting
Kind regards,
Frank