asp.net中的CrystalReportViewer怎样实现分页呢

解决方案 »

  1.   

    设置每页的数量
    http://www.cnblogs.com/skycode/archive/2008/07/24/1712027.html
      

  2.   

    private void pd_PrintPage(object sender, PrintPageEventArgs ev)
    {
    Graphics g = ev.Graphics;
    bool HasMorePages = false;
    PrintElement printElement = null; foreach(XmlNode node in doc["root"]["reporttable"].ChildNodes)
    {
    printElement = Parser.CreateElement(node);//调用解析器生成相应的对象
    try
    {
    HasMorePages = printElement.Draw(g);//是否需要分页
    }
    catch(Exception ex)
    {
    this.label1.Text = ex.Message;
    }
    } //在页底中间输出页码
    Font font = new Font("黑体", 12.0f);
    Brush brush = new SolidBrush(Color.Black);
    g.DrawString("第 " + Pages.ToString() + " 页",
    font,brush,ev.MarginBounds.Width / 2 + ev.MarginBounds.Left - 30,
    ev.PageBounds.Height - 60); if(HasMorePages)
    {
    Pages++;
    }
    ev.HasMorePages = HasMorePages;
    }
    http://blog.donews.com/GodWood/page/3