views:

32

answers:

1

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", 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;
}
+1  A: 

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();
GenericTypeTea
u great man..i am fighting with this problem last two day, ur single line code solved my prob...thanks a lot
Ayyappan.Anbalagan