项目实例:车辆信息统计报表管理系统--WinForm、Web打印设计

  WinForm、Web打印设计,主要是设计的方法,详细代码自己实现了

    private void ReportGIS_Load(object sender, EventArgs e)

    {

     Document doc = new Document(DocumentId, wd, this);

     show();//show后才调用btnPrint_Click

    }

 

    public Document(int pDocumentId, WidgetDrive pWidgetDrive, System.Windows.Forms.Form pForm)

    {

      GridHelper.OnPrint += new EventHandler(btnPrint_Click);

    }

    private void btnPrint_Click(object sender, EventArgs e)

    {

     Print();

    }

    public void Print()

    {

     string html = RenderHtml(true);

     //...

     //...

     wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(PrintDocument);//打印

    }

 

    private string RenderHtml(bool pShowCommand)  

    {

    //Table tb = SetPageLayout(pShowCommand);

    }

 

    private Table SetPageLayout(bool pShowCommand)

    {

    //动态生成打印布局

    //每个器件的宽度,高度,框架,打印、导出按钮是否显示

    //标题的翻译

    if(wb.WebControl is GridView)

    {

    // 根据器件的的类型给相应的宽度

    }

 

    RowAddCell(row, ctrlCol, wb.WebControl, pShowCommand);

    //开始加备注

    }

 

    private void RowAddCell(TableRow pTableRow, int pColumnSpan, System.Web.UI.Control pWebControl, bool pShowCommand)

    {

     if (wc.AccessKey == "X")//左上角标识

     {

     //第一次循环加左上角

     //加蓝色滚动条

      }

    }

 

转载于:https://www.cnblogs.com/Gemgin/archive/2013/06/13/3136343.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值