日期:2014-05-17 浏览次数:20420 次
protected void Button1_Click(object sender, System.EventArgs e)
{
GetReport();//给报表绑定数据
lblCount.Text = ReportViewer1.LocalReport.GetTotalPages().ToString();//获取报表总页数
txtPage.Text = ReportViewer1.CurrentPage.ToString();//当前页
}
lblCount.Text = ReportViewer1.LocalReport.GetTotalPages().ToString();
txtPage.Text = ReportViewer1.CurrentPage.ToString();
//方法一:
StatusBar bar = crystalReportViewer1.Controls[4] as StatusBar;
string[] s = bar.Panels[1].Text.Split(':');
int total = Convert.ToInt32(s[1]);
//方法二:
ReportDocument rptDocument = (ReportDocument)crystalReportViewer1.ReportSource;
CrystalDecisions.Shared.ReportPageRequestContext rprc = new CrystalDecisions.Shared.ReportPageRequestContext();
int totalPCount = rptDocument.FormatEngine.GetLastPageNumber(rprc);
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConn = new SqlConnection("Data Source=192.168.0.36;Initial Catalog=Northwind;User ID=sa;Password=sa");