如何将报告参数传递给MVC的Telerik报告?

时间:2016-01-04 13:10:19

标签: asp.net-mvc-4 telerik-reporting

将报告参数传递给MVC的Telerik报告时出现问题?

typeReportSource = new TypeReportSource() { TypeName =  typeof(ADP.GRADEBOOK.Reporting.StudentProgressReport).AssemblyQualifiedName };
typeReportSource.Parameters.Add(new Parameter() { Name = "StudentIds", Value = studentValue.Remove(0, 1).ToString() });
typeReportSource.Parameters.Add(new Parameter() { Name = "AssignmentHeadersCount", Value = reportDatas.AssignmentHeadersCount.ToString() });
typeReportSource.Parameters.Add(new Parameter() { Name = "GradeScaleId", Value = reportDatas.GradeScaleID });
typeReportSource.Parameters.Add(new Parameter() { Name = "IncludeDroppedStudents", Value = GetSpecTableDetailCompletedDatas.IncludeDroppedStudents != null ? GetSpecTableDetailCompletedDatas.IncludeDroppedStudents : "" });
typeReportSource.Parameters.Add(new Parameter() { Name = "MarkingPeriodId", Value = MarkingPeriodeId });
typeReportSource.Parameters.Add(new Parameter() { Name = "MarkingPeriodName", Value = MarkingPeriodeNm != null ? MarkingPeriodeNm : "" });
typeReportSource.Parameters.Add(new Parameter() { Name = "PrintFooter", Value = GetSpecTableDetailCompletedDatas.PrintFooter != null ? GetSpecTableDetailCompletedDatas.PrintFooter : "" });
typeReportSource.Parameters.Add(new Parameter() { Name = "ReportConnectionString", Value = (reportDatas.ReportConnectionstring != null ? ADP.GRADEBOOK.Reporting.CipherUtility.Decrypt(reportDatas.ReportConnectionstring) : "") });
typeReportSource.Parameters.Add(new Parameter() { Name = "ReportHeaderName", Value = GetSpecTableDetailCompletedDatas.ReportHeaderName != null ? GetSpecTableDetailCompletedDatas.ReportHeaderName : "" });
typeReportSource.Parameters.Add(new Parameter() { Name = "ReportId", Value = GetSpecTableDetailCompletedDatas.ReportID });
typeReportSource.Parameters.Add(new Parameter() { Name = "SchoolCode", Value = (SchoolCode != null ? SchoolCode : "") });
typeReportSource.Parameters.Add(new Parameter() { Name = "YearID", Value = YearId });
typeReportSource.Parameters.Add(new Parameter() { Name = "SectionId", Value = SectionId });
typeReportSource.Parameters.Add(new Parameter() { Name = "StaffId", Value = staffID });
typeReportSource.Parameters.Add(new Parameter() { Name = "TemplateId", Value = TempID });
typeReportSource.Parameters.Add(new Parameter() { Name = "SchoolId", Value = reportDatas.SchoolID });

嗨,我已经将这样的参数传递给了MVC中的Telerik Reporting,但我得到的是例外

  

创建报告实例时出错(Report = ADP.GRADEBOOK.Reporting.StudentProgressReport,ADP.GRADEBOOK.Reporting,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null)。   参数值缺失或无效。请输入所有参数的有效数据。

My Exception Details here

1 个答案:

答案 0 :(得分:0)

http://www.telerik.com/help/reporting/t_telerik_reporting_typereportsource.html

typeReportSource = new TypeReportSource();

typeReportSource.TypeName =                             typeof(ADP.GRADEBOOK.Reporting.StudentProgressReport).AssemblyQualifiedName;