带数据集的Crystal Report显示报告为空

时间:2013-02-01 09:56:17

标签: c# crystal-reports

您好我正在使用带有数据集的Crystal Report但是当我运行报告时它显示空白记录听到的是我的代码

    private void UpdateReport()
    {
        try
        {
            DateTime StDate = dtpFrom.Value;
            DateTime EdDate = dtpTo.Value;
            DataSet reportData = new DataSet();
            SqlConnection conn = new SqlConnection(DBConnect.CaptureManagerConnectionSting);
            conn.Open();
            SqlDataAdapter da = new SqlDataAdapter();
            SqlCommand cmd = new SqlCommand("SP_GetBountyModelGrouping", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Region", SqlDbType.NVarChar).Value = cboRegion.Text;
            cmd.Parameters.Add("@Country", SqlDbType.NVarChar).Value = cboCountry.Text;
            cmd.Parameters.Add("@StDate", SqlDbType.NVarChar).Value = StDate.ToShortDateString();
            cmd.Parameters.Add("@EdDate", SqlDbType.NVarChar).Value = EdDate.ToShortDateString();
            da.SelectCommand = cmd;
            da.Fill(reportData, "DataTableBountyModelGrouping");
            conn.Close();
            crptBountyModelGrouping rptDoc = new crptBountyModelGrouping();
            rptDoc.SetDataSource(reportData.Tables[0]);
            crystalReportViewer1.ReportSource = rptDoc;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }

请帮我解决这个问题 谢谢 V.G.Salger

0 个答案:

没有答案
相关问题