报表打印系统

报表系统
                      使用说明
                     (ver 1.3.7.0)


一、概述:
B/S应用系统的报表打印一直以来都是一个难题,以前常规的思路是通过在浏览器中安装ActiveX插件以获得直接驱动打印机的能力。
但是,随着浏览器的发展,越来越多的浏览器厂商禁止安装ActiveX,以避免因ActiveX组件导致的各种安全问题。
为解决B/S打印中的痛点,我工作室开发了本报表服务器,完美地解决了在浏览器端不用ActiveX而获得与C/S系统一样的打印能力。
本报表系统不需要在浏览器安装任何插件,只需通过JavaScript即可实现报表精确打印以及打印过程免人工介入。
-------------


二、特点:
1、高兼容:不需要在浏览器端和服务端安装任何插件,在浏览器插件被各大浏览器纷纷禁用的今天,无插件设计兼容绝大多数浏览器;
2、免安装:软件即拷即用,不安装,不污染操作系统,让操作系统历久弥新; 
3、可视化:可视化的模板设计器,通过拖拽即可完成模板设计; 
4、高精度:实现精确到毫米的打印精度,对于一些格式复杂,要求精确打印的场合,可以很容易达到毫米级精度;
5、易套打:可视化的模板设计器,在模板中加入一个票据格式的底图,可以很方便地实现套打,对于实现发票、快递面单、支票等打印毫无压力;
6、功能强:从简单报表、主从报表到嵌套报表甚至交叉报表,均能轻松应对。还有一维二维条形码,甚至,还有逆天的脚本功能,只有想不到,没有做不到;
7、自动化: 打印过程中全部自动化,无需象生成PDF、Word、Excel那样还需要人工再点打印;
8、易部署:打印模板既可以部署在客户端(与 cfprint.exe 程序放在同一目录下),也支持部署在服务端随报表数据一起传到客户端;
9、目标活:支持在数据文件中或模板中指定要输出的打印机,发票用针打、报表用激光打、小票用小票机,专机专打;




三、使用前提条件:
1、IE6以上版本、Chrome(谷歌浏览器)4.0以上版本、Firefox 4.0以上版本、Opera 11以上版本、Safari 5.0.2以上版本、iOS 4.2以上版本
或使用Chrome内核、Firefox内核的浏览器均可直接使用本打印系统;
2、在进行打印前,需要先设计好打印模板(模板设计器请见第五节);
3、打印数据必须Json的格式发送给打印服务器,并且数据必须满足指定的格式(见下文);


四、数据格式说明:
下面以一个跨境电商快递面单数据为例解释一下数据各项的含义;


{
  "template": "waybill.fr3",    /*打印模板文件名。除了指定模板文件以外,还支持把模板嵌入到数据文件中,以实现在服务器端灵活使用打印模板,格式如下:*/
                                /*"template": "base64:QTBBRTNEQTE3MkFFQjIzNEFERD<后面省略>" */


  "ver": 4,                     /*数据模板文件版本*/
  "Copies": 3,                  /*打印份数,支持指定打印份数*/
  "Duplex": 1,                  /*是否双面打印,0:默认,不双面,1:垂直,2:水平,3:单面打印(simplex)*/
  "Printer": "priPrinter",      /*指定打印机,本系统支持在数据文件中指定打印机,也支持在打印模板中指定打印机*/
  "PageNumbers": "",            /*要打印的页码范围,同打印机的打印设置里的格式相同,例如:"1,2,3"表示打印前3页, “2-5”:表示打印第2到5页,“1,2,4-8”表示打印第1、2、4到8页*/
  "Preview": 1,                 /*是否预览,跟主界面上选择“预览”效果相同,取值为0:不预览,1:预览*/


  "Tables":[                    /*数据表数组*/
    {
      "Name": "Table1",         /*表名*/
      "Cols": [                 /*字段定义*/
        {
          "type": "str",        /*字段类型,可选值:String,Str,Integer,Int,Smallint,Float,Long, Blob,*/
                                /*对于图片、PDF等使用Blob类型,并把值进行Base64编码,并加前缀:*/
                                /* "base64/pdf:" 字段值是PDF; "base64/jpg:" 字段值是jpg; "base64/png:" 字段值是png; "base64/gif:" 字段值是gif;  */
          "size": 255,          /*字段长度*/
          "name": "HAWB#",      /*字段名称,必须与打印模板中的打印项名称相同*/
          "required": false     /*字段是否必填*/
        },
        { "type": "int", "size": 0, "name": "NO", "required": false },
        { "type": "float", "size": 0, "name": "报关公司面单号", "required": false },
        { "type": "integer", "size": 0, "name": "公司内部单号", "required": false },
        { "type": "str", "size": 255, "name": "发件人", "required": false },
        { "type": "str", "size": 255, "name": "发件人地址", "required": false },
        { "type": "str", "size": 255, "name": "发件人电话", "required": false },
        { "type": "str", "size": 255, "name": "发货国家", "required": false },
        { "type": "str", "size": 255, "name": "收件人", "required": false },
        { "type": "str", "size": 255, "name": "收件人地址", "required": false },
        { "type": "str", "size": 255, "name": "收件人电话", "required": false },
        { "type": "str", "size": 255, "name": "收货人证件号码", "required": false },
        { "type": "str", "size": 255, "name": "收货省份", "required": false },
        { "type": "float", "size": 0, "name": "总计费重量", "required": false },
        { "type": "int", "size": 0, "name": "总件数", "required": false },
        { "type": "float", "size": 0, "name": "申报总价(CNY)", "required": false },
        { "type": "float", "size": 0, "name": "申报总价(JPY)", "required": false },
        { "type": "int", "size": 0, "name": "件数1", "required": false },
        { "type": "str", "size": 255, "name": "品名1", "required": false },
        { "type": "float", "size": 0, "name": "单价1(JPY)", "required": false },
        { "type": "str", "size": 255, "name": "单位1", "required": false },
        { "type": "float", "size": 0, "name": "申报总价1(CNY)", "required": false },
        { "type": "float", "size": 0, "name": "申报总价1(JPY)", "required": false },
        { "type": "int", "size": 0, "name": "件数2", "required": false },
        { "type": "str", "size": 255, "name": "品名2", "required": false },
        { "type": "float", "size": 0, "name": "单价2(JPY)", "required": false },
        { "type": "str", "size": 255, "name": "单位2", "required": false },
        { "type": "float", "size": 0, "name": "申报总价2(CNY)", "required": false },
        { "type": "float", "size": 0, "name": "申报总价2(JPY)", "required": false },
        { "type": "AutoInc", "size": 0, "name": "ID", "required": false },
        { "type": "blob", "size": 0, "name": "附件", "required": false }
      ],


      "Data": [                /*数据行定义,每一行含义见上面的字段定义*/
        {
          "HAWB#": "860014010055",
          "NO": 1,
          "报关公司面单号": 200303900791,
          "公司内部单号": 730293,
          "发件人": "NAKAGAWA SUMIRE 2",
          "发件人地址": " 991-199-113,Kameido,Koto-ku,Tokyo",
          "发件人电话": "03-3999-3999",
          "发货国家": "日本",
          "收件人": "张三丰",
          "收件人地址": "上海市闵行区虹梅南路1660弄蔷薇八村99号9999室",
          "收件人电话": "182-1234-8888",
          "收货人证件号码": null,
          "收货省份": null,
          "总计费重量": 3.2,
          "总件数": 13,
          "申报总价(CNY)": null,
          "申报总价(JPY)": null,
          "件数1": 10,
          "品名1": "纸尿片",
          "单价1(JPY)": null,
          "单位1": null,
          "申报总价1(CNY)": null,
          "申报总价1(JPY)": null,
          "件数2": null,
          "品名2": null,
          "单价2(JPY)": null,
          "单位2": null,
          "申报总价2(CNY)": null,
          "申报总价2(JPY)": null,
          "ID": 1,
          "附件": "base64/pdf:JVBERi0xLjQKJcDIzNINCjEgMCBvYmoKPDwKL1RpdGxlICh3YXliaWxsLmZyMykKL0F1dGhvciAoc2hlbmcpCi9DcmVhdG9yIChwZGZGYWN0b3J5IFBybyB3d3cucGRmZmFjdG9yeS5jb20pCi9Qcm9kdWNlciAocGRmRmFjdG9yeSBQcm8gNS4zNSBcKFdpbmRvd3MgNyBVbHRpbWF0ZSB4ODYgQ2hpbmVzZSBcKFNpbXBsaWZpZWRcKVwpKQovQ3JlYXRpb25EYXRlIChEOjIwMTcwMjI3MTIyODM2KzA4JzAwJykKPj4KZW5kb2JqCjUgMCBvYmoKPDwKL0ZpbHRlci9GbGF0ZURlY29kZQovTGVuZ3RoIDQwNAo+PnN0cmVhbQ0KSImVVMlOw0AMvecrTLkUoZqxZ80VhR44gTQSH4CKEKJIhQO/j2cS0skGrRo1cWy/97xkDvAIByC4B4We4Rso5EvZZLLxaAx87uAVnuCjIg5o5bULqBn2FVmk3nzvTNKYjTZ2aPWhX1XivY3VzZauCWqsHcSXqhCyIVDykxspSbQOa4a4F7dwxGdYw8UVxDcB4D79mBMIgymyNgqV0brNfMiJKj832w6llHHEcZQAZthXlznvLlZSRBve/kuQIfROkqTy2MwKZcFxKbg5UxnVSUhOnJEyniVxiiZSaKSLGEB4ORznOem/FIC1d1S37SfmpDMB2K587WywphzAMq+WNNcTC9CQmAtaGhJKpgtLc5O6Qwhlj5YlWAFaVnBC6TYDjksftvyvNW43WG6yDkmQFy25sjV0sx76XdKa3NOlGYf20vq1GfqNyRsi/mbWr11HNbdok+DfiaxXs2CcGp3c5XchApUn5aF/2ExfWYtKThw5KMx/3/dJeK5GlnVnf9YKjao/hSgkxWTySZMbUyzFD6PnEr4KZW5kc3RyZWFtCmVuZG9iago0IDAgb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M5Mzk3RDRFNEQxNzZCMDkwQ0VFNzkzMTM0Rj5dCj4+CnN0YXJ0eHJlZgo0MzU2CiUlRU9GCg==",
        },
        {
          "HAWB#": "860014010035",
          "NO": 2,
          "报关公司面单号": 200303900789,
          "公司内部单号": 730291,
          "发件人": "NAKAGAWA SUMIRE",
          "发件人地址": " 991-199-113,Kameido,Koto-ku,Tokyo",
          "发件人电话": "03-3999-3999",
          "发货国家": "日本",
          "收件人": "张无忌",
          "收件人地址": "上海市闵行区虹梅南路1660弄蔷薇八村88号8888室",
          "收件人电话": "182-1234-8888",
          "收货人证件号码": null,
          "收货省份": null,
          "总计费重量": 3.2,
          "总件数": 13,
          "申报总价(CNY)": null,
          "申报总价(JPY)": null,
          "件数1": 10,
          "品名1": "纸尿片",
          "单价1(JPY)": null,
          "单位1": null,
          "申报总价1(CNY)": null,
          "申报总价1(JPY)": null,
          "件数2": null,
          "品名2": null,
          "单价2(JPY)": null,
          "单位2": null,
          "申报总价2(CNY)": null,
          "申报总价2(JPY)": null,
          "ID": 2,
          "附件":"base64/gif:R0lGODlhrgCuAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ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YuQV6soSaBGR2OrRFAfpwj0hjIENcZMABcqeAniNmMYs0qg7K7VEkGwhmStlEspmShVYZhi27Jzpxdi6blzEnV4zItnHVSljk5GIK//X/NGOpCp8HQ5oltVk8ZNLIk/DEYSBdycg2vlCg0GrmVGDZykHWEnWsUWBpLrXKl4yzYMr7i+poGb05yktI1/ufQkPqtYZ6qjyIeg5Iw8RJ/l0UopcUIn0eeLa39VOiOsVp8YRKVMwpyac/DRkWJaa2v3XwoPxhYuFg2bjpbbNM6LwiOjkayKBGlY3PLBI/CeZSk361h3qk6O5u5ySgRlA/smRmuBj3OhXGDY/vcqYhu+Iza+aVcXt96/J2uMnRIVUyCeQqTAtb0cPOqZOLDewXwcQ+s35SNBq9Iw2BY8FeYZSllG3oBWf42QZKNkofjahlRorL0FYUZk6zqWtvR7iwwNLRsbPlISFBJ9vc7lKqFo0pbl3rRTwKd7iUte1+gmk+316Eno1lkVt929pL/me6ucVuAzPr3IeepLrdvSptzxNezbI0f+V9rWhJmd71aQ657dUnbeP7vKfRd5hQHep9KZZf7e13mCwM3H/1qr7NDpiHUz3tgU+KM2wumL9JPOmDBTgws05YqbWS64UBnFUJb5jAb9Luhx8HXPiOWLGBOvF3S2ZgFdNMxC7+bYtjTOMa2/jGOM6xjnfM4x772MYBAQA7"
        }
      ]
    },
    {
      "Name": "Table2",
      "Cols": [
        { "type": "int", "size": 0, "name": "NO", "required": false },
        { "type": "float", "size": 0, "name": "订单编号", "required": false },
        { "type": "integer", "size": 0, "name": "下单日期", "required": false },
        { "type": "str", "size": 255, "name": "下单平台", "required": false }
      ],
      "Data": [
        {
          "NO": 1,
          "订单编号": 200303900791,
          "下单日期": "2017-01-20",
          "下单平台": "天猫"
        },
        {
          "NO": 2,
          "订单编号": 200303900792,
          "下单日期": "2017-01-20",
          "下单平台": "京东"
        }
      ]
    }
  ]
}




五、调用示例:






康虎云报表系统测试




 

   

康虎云报表系统


   

打印测试(模式1)


   

     
   

 

 
















//如果有php运行环境,只需把该文件扩展名改成 .php,然后上传到web目录即可在真实服务器上测试
header("Access-Control-Allow-Origin: *");
?>





康虎云报表系统测试





 

   

康虎云报表系统(Ver 1.3.0)


   

打印测试(模式2)


   

     

      一、首先按下列步骤设置:

      1、运行打印服务器;

      2、按“停止”按钮停止服务;

      3、打开“设置”区;

      4、在“常用参数-->服务模式”中,选择“模式2”;

      5、按“启动”按钮启动服务。
     

     

      二、按本页的“打印”按钮开始打印。

     


     


      
     

        由于JavaScript在不同域名下访问会出现由来已久的跨域问题,所以正式部署到服务器使用时,要解决跨域问题。

        对于IE8以上版本浏览器,只需增加一个reponse头:Access-Control-Allow-Origin即可,而对于php、jsp、asp/aspx等动态语言而言,增加一个response头是非常简单的事,例如:

        在php:

<?php

header("Access-Control-Allow-Origin: *");

?>

       

        在jsp:

<%  

response.setHeader("Access-Control-Allow-Origin", "*");  

%>

       

        在asp.net中:

Response.AppendHeader("Access-Control-Allow-Origin", "*");
       

其他语言里,大家请自行搜索“ajax跨域”。而对于IE8以下的浏览器,大家可以自行搜索“IE6+Ajax+跨域”寻找解决办法吧,也可以联系我们帮助。
     

   

 

 

























六、模板设计器(重要!重要!!,好多朋友都找不到设计器入口)
在主界面上,双击右下角的“设计”两个字,即可打开模板设计工具箱,在工具箱有三个按钮和一个大文本框。三个按钮的作用分别是:
设计:以大文本框中的json数据为数据源,打开模板设计器窗口;
预览:以大文本框中的json数据为数据源,预览当前所用模板的打印效果;
打印:以大文本框中的json数据为数据源,向打印机输出当前所用模板生成的报表;


以后将会有详细的模板设计教程发布,如果您遇到紧急的难题,请向作者咨询。


你可能感兴趣的:(报表打印系统)