Vishnu Suresh

Vishnu Suresh

  • NA
  • 34
  • 12.7k

problem with crystal report in aspnet

Sep 29 2015 5:41 AM
I have a web program in which datas are to be printed using crystal report. The front end in asp.net and back end is sql. Now I have created the crystal report to display the data. But the problem is it is showing all the datas in the table. I need to show only specific data.
If the user type Code number 11124 on the textbox then the crystal report need to show the data relate to code 11124. But now its showing all the datas in the table.
How can I do this.

protected void Page_Load(object sender, EventArgs e)

{

ReportDocument crystalReport = new ReportDocument();

crystalReport.Load(Server.MapPath("CrystalReport4.rpt"));

crystalReport.SetDatabaseLogon

("name"@passwd", @"databasename)

CrystalReportViewer1.ReportSource = crystalReport;

}
 This is the code to show the crystal report viewer. Is there any way here I can put the sql statement like select * from table where code=@code.
 

Answers (19)