水晶报表问题移至下一页 [英] Crystal report problem move next page
本文介绍了水晶报表问题移至下一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好.我在移动下一页时遇到问题.假设我有5页的报告.我只能从第一页移动到第二页.无论我单击下一步按钮如何,页面都会在第二页上继续显示.它没有移到第三页而不是第四页...
我的代码如下:
Hello. I have a problem with move next page. Assume that i have 5 pages of report. I can only move from first page to second page only. whatever i click next button, page keep showing on second page. It doesn''t move to 3rd page than 4th...
my code is below :
private ReportDocument report;
private String reportName = "ABCrpt.rpt";
protected void NextButton_Click(object sender, EventArgs e)
{
this.BindReport();
this.rptviewer.ShowNextPage();
}
private void BindReport()
{
if (Session["Rep"] == null)
{
Hashtable Params = new Hashtable();
Params.Add("StartDate", Convert.ToDateTime(this.StartDateFlexDevCalendar.GetDate));
Params.Add("EndDate", Convert.ToDateTime(this.EndDateFlexDevCalendar.GetDate));
report = new ReportDocument();
report.Load(Server.MapPath("EN/" + reportName ));
TableLogOnInfos tblLogonInfos = new TableLogOnInfos();
TableLogOnInfo tblLogonInfo = new TableLogOnInfo();
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "sokheng";
connectionInfo.UserID = "sa";
connectionInfo.Password = "1234";
connectionInfo.DatabaseName = "DatabaseABC";
foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in report.Database.Tables)
{
tblLogonInfo = tbl.LogOnInfo;
tblLogonInfo.ConnectionInfo = connectionInfo;
tbl.ApplyLogOnInfo(tblLogonInfo);
}
if (Params != null)
{
foreach (DictionaryEntry p in Params)
{
report.SetParameterValue(Convert.ToString(p.Key), Convert.ToDateTime(p.Value));
}
}
Session["Rep"] = report;
}
report = (ReportDocument)Session["Rep"];
this.rptviewer.ReportSource = report;
this.rptviewer.DataBind();
}
因此,请帮助我...解决该问题该怎么办?
So please help me ... what should I do to solve this problem ?
推荐答案
Crystal Reports查看器内置了工具栏,其中包含用于浏览报表的按钮.在这里说明
http://www.c-sharpcorner.com/UploadFile/mahesh/CrystalReportsViewer11082005044044AM/CrystalReportsViewer.aspx [ ^ ]
The crystal reports viewer has built in toolbar which contains the buttons to navigate the report as explained here
http://www.c-sharpcorner.com/UploadFile/mahesh/CrystalReportsViewer11082005044859AM/CrystalReportsViewer.aspx[^]
我遇到了同样的问题,并将报告加载代码移至page_init
I had the same problem and i moved the report loading code in page_init
这篇关于水晶报表问题移至下一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文