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

本文详细介绍了使用WinForm和Web技术进行打印设计的方法,包括文档创建、页面布局生成及HTML渲染,最终实现打印功能。

  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")//左上角标识

     {

     //第一次循环加左上角

     //加蓝色滚动条

      }

    }

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值