Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi i am new to ssrs reporting services .but i was done partially .Actually i was done ssrs report in BIDS.i depoly it.it is displaying web page.but i want to display in windowsfrom application for that i was worte a code given below

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Net;
using System.Security.Principal;

using Microsoft.Reporting.WinForms;



namespace WindowsReportViwer
{
    public partial class ViewerForm1 : Form
    {

        public ViewerForm1()
        {
            InitializeComponent();
        }

        private void ViewerForm1_Load(object sender, EventArgs e)
        {

            this.reportViewer1.RefreshReport();

        }

        private void btnShowReport_Click(object sender, EventArgs e)
        {
            reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
            reportViewer1.ServerReport.ReportServerUrl = new      Uri(@"http://Rahul/ReportServer");
            reportViewer1.ServerReport.ReportPath=
           "/sample/Registration";
            reportViewer1.ServerReport.ReportPath = txtReportUrl.Text;
            reportViewer1.RefreshReport();
        }
    }
}



but i am getting errors at processing mode,serverReport to slove this errors any hearder file has been required plz help me ..
Posted
Comments
[no name] 21-Jul-13 17:04pm    
What errors?

1 solution

Let try:

C#
string Server = "http://hn-sd-0100-wk/ReportServer_SQL2008R2";//ReportServerTextBox.Text;
            string reportProject = "/ReportProjectContact/";
            string reportName = "ReportContact";
            reportViewer1.ProcessingMode = ProcessingMode.Remote;
            ServerReport serverReport;
            serverReport = reportViewer1.ServerReport;
            serverReport.ReportServerUrl = new Uri(Server);
            serverReport.ReportPath = reportProject + reportName; //FolderTextBox.Text + ReportNameTextBox1.Text;
               
            // You can add Parameter if need
            ReportParameter[] rp = new ReportParameter[1];
            rp[0] = new ReportParameter("OrderID", txtOrderID.Text);
            reportViewer1.ServerReport.SetParameters(rp);
            reportViewer1.RefreshReport();
 
Share this answer
 
Comments
Member 9846414 22-Jul-13 4:04am    
thank u very much.but can u tell me how to give path .
Member 9846414 25-Jul-13 14:33pm    
thank u very much sir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900