public static string PartialFormat <TReportModel>(this IEntityReport <TReportModel> report, string formatString, params string[] values) { if (values == null || values.Length == 0) { throw new Exception("Expression parameters are required."); } var paramsString = string.Join(", ", values); return(string.Format("Format('{0}', {1})", formatString, paramsString)); // todo: clean formatString }
public static string ChildMemberField <TReportModel, TParent>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TParent> > parentMember, Expression <Func <TParent, object> > childMember, string formatString = null) { return(string.IsNullOrWhiteSpace(formatString) ? BuildFieldBinding(childMember) : _Format(childMember, formatString)); }
public static string CountOfField <TReportModel>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, double> > expression, string formatString = null) { return(CountExpression(expression, formatString)); }
public static string SumOfField <TReportModel>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, long> > expression, string formatString = null) { return(SumExpression(expression, formatString)); }
public static string JoinField <TReportModel>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, object> > expression, string separator) { return(string.Format("=Join('{1}', {0})", PartialField(report, expression), separator)); }
public static ReportTable <TReportModel, TTableModel> Table <TReportModel, TTableModel>(this IEntityReport <TReportModel> report, Table table, Expression <Func <TReportModel, IEnumerable <TTableModel> > > dataSourceExpression) { return(new ReportTable <TReportModel, TTableModel>(table, dataSourceExpression)); }
public static string Field <TReportModel, TMember>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TMember> > memberAccessExpression, string formatString = null) { return(string.IsNullOrWhiteSpace(formatString) ? BuildFieldBinding(memberAccessExpression) : _Format(memberAccessExpression, formatString)); }
public static SubReportBinder <TReportModel, TSubReportModel> Bind <TReportModel, TSubReportModel>(this IEntityReport <TReportModel> report, SubReport subreport, Func <TReportModel, TSubReportModel> source) { return(new SubReportBinder <TReportModel, TSubReportModel>(subreport, source)); }
public static void Bind <TReportModel, TReportItem, TBind>(this IEntityReport <TReportModel> report, TReportItem reportItem, Expression <Func <TReportItem, TBind> > member, Expression <Func <TReportModel, TBind> > value, string formatString = null) where TReportItem : ReportItemBase { reportItem.Bindings.Add(new Binding(MemberAccessPathBuilder.GetPath(member), Field(null, value, formatString))); }
public static string PartialField <TReportModel, TMember>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TMember> > expression, string formatString) { return(_Format(expression, formatString, true)); }
public static string PartialField <TReportModel, TMember>(this IEntityReport <TReportModel> report, Expression <Func <TReportModel, TMember> > expression) { return(string.Format("Fields.{0}", MemberAccessPathBuilder.GetPath(expression))); }