none
Reg: Building custom webpart for report viewer

    Question

  • hi

    I am having the ssrs configured to MOSS 2007 in integrated mode, i want to create the custom report viewer web part  for that.

    the rdl  file and data source file are deployed to sharepoint report library (http://SharepoitnSite/TestReportLibrary/ReportFolder/Report1.rdl)

    I am trying the below code , but it is not helping me out, can any one please help me out in this.

    public class CustomReportViewerWebpart : WebPart
        {
            protected override void CreateChildControls()
            {
                ReportViewer reportviewer = new ReportViewer();
                reportviewer.EnableViewState = true;
                reportviewer.ProcessingMode = ProcessingMode.Remote;
                reportviewer.ServerReport.ReportServerUrl = new Uri("http://SharepoitnSite/TestReportLibrary/");


                reportviewer.ServerReport.ReportPath = "http://SharepoitnSite/TestReportLibrary/ReportFolder/Report1.rdl";
                //reportviewer.ServerReport.SetParameters(new ReportParameter("parm","12"));
        


                reportviewer.ShowToolBar = true;


                reportviewer.ShowParameterPrompts = true;
                reportviewer.AsyncRendering = false;
             


                Controls.Add(reportviewer);
                base.CreateChildControls();
            }
         
        }

    Getting some error on rendering of report--- > Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <HTML dir="ltr"> <HEAD><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid"  


    regards Vimal

    Friday, February 24, 2012 7:16 AM

Answers