We help IT Professionals succeed at work.

C# RDLC Load

Kevin_Foley
Kevin_Foley used Ask the Experts™
on
I been reading websites for a week.  I have been using Crystal Reports for reporting but always seem to have trouble getting it to deploy correctly.  It works on one server but not the other, stops working, etc.

I want to try using RDLC for deployment reasons and while I can create the report, I'd like to be able to load it through C# code like I do with Crystal.

Can anyone point me in the Microsoft Reports equivelent to the following Crystal Code??

~~~~~~~~~~~~~~~
ReportDocument reportDocument = new ReportDocument();

            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            ParameterField paramField = new ParameterField();
            //ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
            paramField.Name = "@ID";
            //Session["S_MD_ID"] = "13116";
            paramDiscreteValue.Value = Session["S_ID"];
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);


            CrystalReportViewer2.ParameterFieldInfo = paramFields;
            reportDocument.Load(Server.MapPath("RPT_Detail.rpt"));
            CrystalReportViewer2.ReportSource = reportDocument;
            //reportDocument.SetDatabaseLogon("sql", "k33p1tr3al", "c68603-120635/mdsolutions", "MDEligibility");
            reportDocument.SetDatabaseLogon(CommonConstants.SQLLoginID, CommonConstants.SQLPassword, CommonConstants.SQLServer, CommonConstants.SQLDBS);
            reportDocument.DataSourceConnections[0].SetConnection(CommonConstants.SQLServer, CommonConstants.SQLDBS, CommonConstants.SQLLoginID, CommonConstants.SQLPassword);
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. Software Engineer
Commented:
Hi, Before deploying the project on server, Is this working on Localhost.... ??
If yes, then you need to check the server compatibility.
Check that whether the server you are using is support the Crystal Reports or Not..