C#crystal报告参数缺失错误

时间:2012-05-26 07:03:38

标签: c#

我试图加载报告使用参数选择。我已经手动完成所有必要的事情到表单并报告。但我没有得到报告的价值。报告显示为空白。这就是我在后面编写的代码。

using CrystalDecisions.CrystalReports.Engine;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        ReportDocument reportdocument = new ReportDocument();
reportdocument.Load(Server.MapPath("MR1.rpt"));
//reportdocument.SetDatabaseLogon("", "", "SureshDasari", "MySampleDB");
reportdocument.SetParameterValue("Material_Code", txtMC.Text);
CrystalReportViewer1.ReportSource = reportdocument;
    }
}

请纠正我

1 个答案:

答案 0 :(得分:0)

您已注释掉登录参数。您是否将“启用数据库登录提示”设置为true?

然后尝试加载完整路径加载:

reportDocument.Load(@"FullPathOfYourReport");