Visual Studio 2012旗舰版Sql Server:2005问题是,当我将参数值传递给crystal报表时,首先它会在浏览器中显示确切的结果但是当我点击下一页时它会显示null结果 .
following is a simple stored procedure
Create Procedure SP_SearchDDO @ddo varchar(10)
{
As
Begin
Select * from PData where DDO = @ddo
end
}
Here is the code
Protected void btn_search_Click(object sender, EventArgs e)
{
ReportDocument rptDoc = new ReportDocument();
string rptPath = Server.MapPath("ddoReprt.rpt");
rptDoc.Load(rptPath);
rptDoc.SetParameterValue("@ddo", "ABC");
CrystalReportViewer1.ReportSource = rptDoc;
}
当我点击浏览器中的搜索按钮时,它显示了确切的 "ABC" 所需结果,当我点击下一页按钮(Crystal报表查看器嵌入按钮)时,"ABC"参数结果丢失并显示空结果 . Plz告诉我我做错了什么?
2 回答
你试过吗
对于crystalreprotviewer,ReuseParameterValuesOnRefresh =“True”?
我已经解决了这个问题,以下是步骤
在水晶报表中展开参数字段==> @parameterValue ==>单击此处编辑将 List of values 更改为动态,然后单击确定,如下图所示 .