简体   繁体   English

C#水晶报表参数丢失错误

[英]C# crystal report parameter missing error

i have tried to load the report make use of parameter selection. 我尝试使用参数选择来加载报告。 i have done the all neccesssary things manually to the form and report also. 我已经手动完成了所有必要的工作,并向表单进行了报告。 Bt i did'nt get the value on the report. 但是我没有得到报告的价值。 report would shown as blank. 报告将显示为空白。 This is what the code i have written in form behind. 这就是我后面编写的代码。

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;
    }
}

Please correct me 请纠正我

You have commented out the Logon parameters. 您已注释掉“登录”参数。 Have you set "Enable Database Logon Prompting" to true? 您是否将“启用数据库登录提示”设置为true?

And try Loading full path load: 并尝试加载完整路径负载:

reportDocument.Load(@"FullPathOfYourReport");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM