2013-12-12 1 views
0

Telerik Reporting을 처음 사용했습니다. &이 ASP.net MVC 응용 프로그램에 보고서 뷰어를 추가하기 시작했습니다. 런타임에 ReportViewer에 "Bad Request"가 표시됩니다 & Fiddler가 오류 메시지 아래에 표시됩니다.ASP.net MVC - Telerik보고 오류 =>/api/reports/clients가 "누락 된 보고서 이름"을 반환합니다.

메시지 : POST/API/보고서/클라이언트/215829-979c/매개 변수는 HTTP/1.1 은 "보고서 이름을 누락"

이 날이에 도움을 주시기 바랍니다 수 있습니다.

보고서 뷰어 코드 :

Html.TelerikReporting().ReportViewer() 
        .Id("reportViewer1") 
        .ServiceUrl("/api/reports") 
        .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html") 
        .ReportSource(Model.ReportSource) 
        .ViewMode(ViewModes.INTERACTIVE) 
        .ScaleMode(ScaleModes.SPECIFIC) 
        .Scale(1.0)     

당신을 감사 -nm

답변

0

내가 그 코드는 귀하의 게시물에없는 당신이 컨트롤러에서 보고서를 전달하는 방법을 잘 모르겠어요, 그러나 다음과 같이 보고서의 어셈블리 이름을 직접 참조하여 문제를 해결할 수 있습니다 ("응용 프로그램"을 루트 네임 스페이스로 대체).

@{ 
var typeReportSource = new TypeReportSource() { TypeName = "Application.Reports.Report1, Application" }; 
} 
@(
Html.TelerikReporting().ReportViewer() 
    .Id("reportViewer1") 
    .ServiceUrl("/api/reports/") 
    .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html") 
    .ReportSource(typeReportSource) 
    .ViewMode(ViewModes.PRINT_PREVIEW) 
    .ScaleMode(ScaleModes.SPECIFIC) 
    .Scale(1.0) 
    .PersistSession(true) 
)