Question : Passing Parameters to Crystal Report Viewer - ASP.Net / C#.Net



I have developed the crystal report which is there in my Application Root Path.

I need to display the report, Based on selecting a Value from List Box.
ListBox - Value - Memberid is passed as Input for Stored Procedures which is then Populated to Crystal Report.


In this, I dont know - How to pass parameter & set the StoredProcedure.

If i am executing the Report.rpt directly from Crystal Report 2008 Editor it works fine by entering the Parameter Id.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
BusinessLogic.BLReport objBL = new BLReport();
            DataSet objDs = new DataSet();
            int iMemberId = 0;
 
            iMemberId = Convert.ToInt32(lstMember.SelectedValue);
            objDs = objBL.GenerateReport(iMemberId);
 
            string strReportPath = string.Empty;
            strReportPath = "C:\\MemberInsurance\\Report\\Report1.rpt";
 
            CrystalDecisions.CrystalReports.Engine.ReportDocument rptDocument = new ReportDocument();
            rptDocument.Load(strReportPath);
 
            rptDocument.SetDataSource(objDs.Tables[0]);
            rptViewer.ReportSource = rptDocument;

Answer : Passing Parameters to Crystal Report Viewer - ASP.Net / C#.Net

Random Solutions  
  •  How can I print using a Clipper (DOS) application under Windows 7
  •  can i use right([ClientName] to get the last part of a string in a Microsoft Access query if i don't know how long the last part is?
  •  VB 2010 - Connection to MS Access
  •  Expert Notify Thread - For Experts only (those answering questions in the MS Access Zone).
  •  Append from Access to SQL Server key violation on any second query
  •  How do I remove special characters in a query?
  •  VPN client (Check point Secure client) not able to browse to any website on the machine once connected to the VPN.
  •  How do I migrate Exchange 2003 Public Folder to Exchange 2007 using PFMigrate?
  •  Cannot use remote executables after I upgraded to R2
  •  How do you import outlook express 6 messages into Windows Live Mail and have them in the proper folders?
  •  
    programming4us programming4us