不知道是自己水平不够,还是水晶报表自身的缺陷,水晶在纸张控制这块比较弱(特别是半联Letter),达不到客户需求,改ActiveReport 3.0 纸张方面倒是解决了,但在行(套打)固定方面,又让我伤脑筋,经过两天的摸索,终于搞定:
if( rpt.PageNumber.ToString() ==((TextBox)rpt.Sections["PageHeader1"].Controls["txtField11"]).Text)
{
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrOrderTotalX1"]).Visible=true;
}
1.可控制控件是否显示
2.变量的更改
补充:
判断是否到了页尾,通常是用于固定行数,最后一页显示汇总数据
public bool ActiveReport_FetchData(bool eof)
{
if(eof==true)
{
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrOrderTotalD1"]).Visible=true;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrOrderTotalX1"]).Visible=true;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrPayedD1"]).Visible=true;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrPayedX1"]).Visible=true;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrBalanceD1"]).Visible=true;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrBalanceX1"]).Visible=true;
}
else
{
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrOrderTotalD1"]).Visible=false;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrOrderTotalX1"]).Visible=false;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrPayedD1"]).Visible=false;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrPayedX1"]).Visible=false;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrBalanceD1"]).Visible=false;
((TextBox)rpt.Sections["PageFooter1"].Controls["txtrBalanceX1"]).Visible=false;
}
return eof;
}