how to solve this Problem in asp.net crystal report
Problem in crystal report After excecuting the bellow code,In my report page it ask like "The report you requested requires further information" server= user= password= databse=
protected void Page_Load(object sender, EventArgs e)
{
MySqlConnection sqlcom = new MySqlConnection("server=localhost;userid=root;password=root;database=hemaepdb;");
MySqlCommand cmd = new MySqlCommand("SP_ViewBillDetails"开发者_如何学Go, sqlcom);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("p_Invoice_Id", MySqlDbType.Int16).Value = 1;
cmd.Parameters.Add("p_Org_id", MySqlDbType.Int16).Value = 1;
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
DataSet dsTest = new DataSet();
sqlcom.Open();
adapter.Fill(dsTest, "Table");
sqlcom.Close();
CrystalReportViewer1.Visible = true;
ReportDocument myRpt = new ReportDocument();
myRpt.Load(Server.MapPath("CrystalReport.rpt"));
myRpt.SetDatabaseLogon("root", "root", "localhost", "hemaepdb");
myRpt.SetDataSource(dsTest);
CrystalReportViewer1.ReportSource = myRpt;
}
Use a DataTable instead of a DataSet:
myRpt.SetDataSource(dsTest.Tables[0]);
And add the following to the end of the method:
CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.DataBind();
精彩评论