JRT集中打印

之前一直在夯实基础,现在是补demo的时段了。了解过检验集中打印的人知道,集中打印的逻辑有多复杂。既要考虑普通检验报告加上换页。又要考虑微生物报告加上换页,既有A5的报告,也有A4的报告,还要考虑A4打印两个组装A5时候的Y坐标问题。实现起来是超级复杂的,而JRT在本次设计之初就决心整治打印问题,要最大程度的减少打印业务的复杂度。JRT先后提供了容错PAGE、A4Double元素、表格元素、以及封装打印元素绘制协议来解决打印复杂度问题。

集中打印作为打印的综合测试来验证JRT对打印设计的有效性,下图是效果,寥寥几行代码就完成了M时代最令人头大的集中打印效果,这是目前我实现的最强大的打印体系,只为使用JRT的系统提供支持。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

集中打印的业务后台示例

import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;
import JRTPrintDraw.JRTPrintDrawProtocol;import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;/*** 作为集中打印的示例代码,把之前的打印元素测试、表格测试、模板打印报告测试整合成A4上下打印两个的集中打印,提供强悍的打印整合能力*/
public class CenterPrintTest extends BaseHttpHandlerNoSession {/*** 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制** @param RowID   业务主键* @param P1* @param P2* @param P3* @param P4* @param P5* @param P6* @param P7* @param P8* @param P9* @param P10* @param P11* @param P12* @param P13* @param Session* @param Output* @return*/public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {List<PrintElement> retList = new ArrayList<>();//标志A4打印两个retList.add(PrintDrawProtocol.A4Double(false));//打条码最初的打印示例String barCodeTestJson=Helper.GetVMData("vm.test.PrintBarCodeTest","GetData",null,Session,Output);List<PrintElement> barCodeTestJsonList=Helper.Json2List(barCodeTestJson,PrintElement.class);retList.addAll(barCodeTestJsonList);//换页retList.add(PrintDrawProtocol.ChangePage());//打表格最初示例String drawGridJson=Helper.GetVMData("vm.test.DrawGrid","GetData",null,Session,Output);List<PrintElement> drawGridJsonList=Helper.Json2List(drawGridJson,PrintElement.class);retList.addAll(drawGridJsonList);//换页retList.add(PrintDrawProtocol.ChangePage());//用模板打印报告的示例String printTemplateTestJson=Helper.GetVMData("vm.test.PrintTemplateTest","GetData",null,Session,Output);List<PrintElement> printTemplateTestJsonList=Helper.Json2List(printTemplateTestJson,PrintElement.class);retList.addAll(printTemplateTestJsonList);//换页retList.add(PrintDrawProtocol.ChangePage());//返回整合的集中打印return Helper.Object2Json(retList);}
}

打印元素的测试业务代码

import JRT.Core.Dto.OutParam;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;import java.awt.*;
import java.util.ArrayList;
import java.util.List;/*** 输出符合打印元素绘制协议的打印元素数据,来供打印执行层打印*/
public class PrintBarCodeTest extends BaseHttpHandlerNoSession {/*** 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制** @param RowID   业务主键* @param P1* @param P2* @param P3* @param P4* @param P5* @param P6* @param P7* @param P8* @param P9* @param P10* @param P11* @param P12* @param P13* @param Session* @param Output* @return*/public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {List<PrintElement> retList = new ArrayList<>();//控制打印机//retList.add(PrintDrawProtocol.ControlPrinter("A5", PrintDrawProtocol.PrintLayout.Portrait,"pdf","",0,0));//标志A4打印两个//retList.add(PrintDrawProtocol.A4Double(true));//打印PDF文件//retList.add(PrintDrawProtocol.DrawFile("http://localhost:8080/JRTWeb/FileService/test.pdf"));retList.add(PrintDrawProtocol.DrawPDF("http://localhost:8080/JRTWeb/FileService/test.pdf"));//换页retList.add(PrintDrawProtocol.ChangePage());//换页retList.add(PrintDrawProtocol.ChangePage());//换页retList.add(PrintDrawProtocol.ChangePage());//页码retList.add(PrintDrawProtocol.DrawPageNum(720, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));//画logoretList.add(PrintDrawProtocol.DrawLabel(420, 10, "http的logn图", "宋体", 22, "", null, "", "#fda632", "0"));retList.add(PrintDrawProtocol.DrawGraph(420, 30, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));retList.add(PrintDrawProtocol.DrawLabel(420, 150, "ftp的logn图", "宋体", 12, "", null, "", "#fda632", "0"));//retList.add(PrintDrawProtocol.DrawGraph(420,180,64,64,"ftp://zlz:zlz@127.0.0.1:21/ftp.png",false,null));//画一个文本retList.add(PrintDrawProtocol.DrawLabel(20, 20, "zhanglianzhu", "宋体", 12, "", null, "", "#ff5252", "0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(20, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(20, 70, 70, 70, 1, "", ""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(20, 90, "jbase", 90, 90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(20, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(20, 230, "20231118 22:49", "宋体", 12, "", null, "", "", "0"));//画一个点retList.add(PrintDrawProtocol.DrawPoint(20, 270, 10, 10, "o", ""));retList.add(PrintDrawProtocol.DrawPoint(100, 270, 10, 10, "[]", ""));retList.add(PrintDrawProtocol.DrawPoint(200, 270, 10, 10, "<>", ""));//画多边形List<Point> pointList = new ArrayList<>();Point p1 = new Point();p1.x = 10;p1.y = 300;pointList.add(p1);Point p2 = new Point();p2.x = 100;p2.y = 310;pointList.add(p2);Point p3 = new Point();p3.x = 50;p3.y = 360;pointList.add(p3);retList.add(PrintDrawProtocol.DrawPoly(pointList, ""));//画复选框retList.add(PrintDrawProtocol.DrawCheckBox(10, 400, true, 30, 30));//画单选框retList.add(PrintDrawProtocol.DrawRadio(60, 400, true, 30, 30));//画复选框retList.add(PrintDrawProtocol.DrawCheckBox(110, 400, false, 30, 30));//画单选框retList.add(PrintDrawProtocol.DrawRadio(160, 400, false, 30, 30));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(20, 1010, "页尾", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawLabel(20, 900, "A4纸张打印", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawLine(20, 920, 700, 920, 1, "0", ""));retList.add(PrintDrawProtocol.DrawLine(20, 940, 700, 940, 1, "1", ""));retList.add(PrintDrawProtocol.DrawLine(20, 960, 700, 960, 1, "2", ""));retList.add(PrintDrawProtocol.DrawLine(20, 980, 700, 980, 1, "3", ""));retList.add(PrintDrawProtocol.DrawLine(20, 1000, 700, 1000, 1, "4", ""));//换一根横线retList.add(PrintDrawProtocol.DrawLine(20, 1025, 700, 1025, 1, "", ""));//换页retList.add(PrintDrawProtocol.ChangePage());//页码retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));//画logoretList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第二页", "宋体", 12, "", null, "", "", "0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231119", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));//画一根横线retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));//换页retList.add(PrintDrawProtocol.ChangePage());//页码retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));//画logoretList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第三页", "宋体", 12, "", null, "", "", "0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231119", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));//画一根横线retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));//换页retList.add(PrintDrawProtocol.ChangePage());//页码retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));//画logoretList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第四页", "宋体", 12, "", null, "", "", "0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231206", "宋体", 12, "", null, "", "", "0"));retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));//画一根横线retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));//先包一个打印元素绘制协议数据生成的工具类来解决元素约束问题,工具类实现了调用工具类得到标签,条码,文本等return Helper.Object2Json(retList);}
}

打印表格的测试业务代码

import JRT.Core.DataGrid.*;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Metrics.DrawMetricsHandler;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;import java.awt.*;
import java.util.*;
import java.util.List;/*** 画表格测试,将要实现一个自动切割和实现换页的表格个业务使用*/
public class DrawGrid extends BaseHttpHandlerNoSession implements IGridChangePage {/*** 打印元素*/private List<PrintElement> retList = new ArrayList<>();/*** 表格换页之前要执行的逻辑* @param gridKey* @param maxY*/public void PreChangePageDo(String gridKey,int maxY){retList.add(PrintDrawProtocol.DrawLabel(20, 10, "这是表格换页之前执行逻辑画的", "宋体", 12, "", null, "", "#fda632", "0"));}/*** 表格换页之后要执行的逻辑* @param gridKey* @param maxY*/public void AfterChangePageDo(String gridKey,int maxY){retList.add(PrintDrawProtocol.DrawLabel(400, 10, "这是表格换页之后执行逻辑画的", "宋体", 12, "", null, "", "#fda632", "0"));}/*** 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制** @param RowID   业务主键* @param P1* @param P2* @param P3* @param P4* @param P5* @param P6* @param P7* @param P8* @param P9* @param P10* @param P11* @param P12* @param P13* @param Session* @param Output* @return*/public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {//这部分由设计器维护的Json得到表格维护信息GridDto def = new GridDto();//边框宽度def.BoderWidth=1;//列数def.Cols=2;//是否左填充def.ColsLeftFull=0;//第一页控制参数GridPageDto page = new GridPageDto();//换页行数page.ChangePageRowNum=8;//顶部page.Top=40;def.PageList.add(page);//第2和后面的页画到500后换页page = new GridPageDto();//顶部page.Top=100;//左边page.Left=30;//换页行数page.ChangePageRowNum=8;def.PageList.add(page);//定义表格的列GridColDto col = null;//表格列for (int i = 0; i < 5; i++) {col = new GridColDto();col.DataField = "Col" + i;col.Width = 75;def.DataCol.add(col);col = new GridColDto();col.DataField = "Col" + i;col.Width = 75;col.PrintFontStyle="Bold";def.HeadCol.add(col);}List<Object> headDatas=new ArrayList<>();//定义表格的标题GridDataDto headData = new GridDataDto();headData.Col0=PrintDrawProtocol.GetMergeGridStr("合并标题头",1,3);headData.Col1="";headData.Col2="";headData.Col3=PrintDrawProtocol.GetMergeGridStr("合并标题头1",1,2);headData.Col4="";headDatas.add(headData);headData = new GridDataDto();headData.Col0="第一列";headData.Col1="第二列";headData.Col2="第三列";headData.Col3="第四列";headData.Col4="第五列";headDatas.add(headData);//这部分由业务打印组装数据List<Object> dataList = new ArrayList<>();//构造测试数据for (int i = 0; i < 21; i++) {GridDataDto one = new GridDataDto();one.Col0 = "第" + (i+1) + "个数据0列,这是比较长的内容额,会自动换行";//合并单元格if(i%4==0){//one.Col0=PrintDrawProtocol.GetMergeGridStr(one.Col0,2,2);}one.Col1 = "第" + (i+1) + "个数据1列,这是稍微长的内容";one.Col2 = "第" + (i+1) + "个数据2列,this is jrtbase draw grid test for printtemplate";one.Col3 = "第" + (i+1) + "个数据3列";one.Col4 = "1.这是第一行$r$n2.这是第二行$r$n3.这是第三行";dataList.add(one);}//控制纸张方向retList.add(PrintDrawProtocol.ControlPrinter("A4", PrintDrawProtocol.PrintLayout.Portrait,"pdf","",0,0));//绘制表格int lastY = PrintDrawProtocol.DrawGrid(retList,def, headDatas, dataList,"G1",this);return Helper.Object2Json(retList);}/*** 数据实体*/public static class GridDataDto {public String Col0;public String Col1;public String Col2;public String Col3;public String Col4;}
}

模板打印报告的测试业务代码

import JRT.Core.DataGrid.GridDto;
import JRT.Core.DataGrid.IGridChangePage;
import JRT.Core.Dto.HashParam;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.Convert;
import JRT.Core.Util.PrintDrawProtocol;
import JRT.Model.Entity.JRTPrintTemplate;
import JRT.Model.Entity.JRTPrintTemplateEle;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;/*** 调用模板数据来打印,这是一个模拟打印的demo,调用模板数据组装打印数据*/
public class PrintTemplateTest extends BaseHttpHandlerNoSession implements IGridChangePage {/*** 打印元素*/private List<PrintElement> retList = new ArrayList<>();/*** 打印模板数据*/JRTPrintTemplateDto template =null;/*** 存打印的Data数据*/Hashtable<String, String> printDataMap =null;/*** 表格换页之前要执行的逻辑* @param gridKey* @param maxY*/public void PreChangePageDo(String gridKey,int maxY){}/*** 表格换页之后要执行的逻辑* @param gridKey* @param maxY*/public void AfterChangePageDo(String gridKey,int maxY){System.out.println("换页后执行逻辑");//画数据元素PrintData(template, retList, printDataMap);//画标签元素PrintLabel(template, retList);//画线元素PrintLine(template, retList);}/*** 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制** @param RowID   业务主键* @param P1* @param P2* @param P3* @param P4* @param P5* @param P6* @param P7* @param P8* @param P9* @param P10* @param P11* @param P12* @param P13* @param Session* @param Output* @return*/public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {//查询模板数据template = GetOneTemplate(null, "JRTReport");//存打印的Data数据printDataMap = new Hashtable<>();printDataMap.put("姓名", "小乌鱼");printDataMap.put("性别", "男");printDataMap.put("年龄", "32岁");printDataMap.put("登记号", "0947809");printDataMap.put("检验号", "24011901");printDataMap.put("科室", "体检科");printDataMap.put("标本", "全血");printDataMap.put("床号", "");printDataMap.put("诊断", "体检");printDataMap.put("采集日期", "2024-01-19");printDataMap.put("采集时间", "16:00");printDataMap.put("医嘱备注", "体检");printDataMap.put("医嘱名称", "血细胞分析五分类");printDataMap.put("申请医生", "乌鱼");printDataMap.put("申请日期", "2024-01-19");printDataMap.put("操作者", "李四");printDataMap.put("审核日期", "2024-01-19");printDataMap.put("审核时间", "17:00");printDataMap.put("审核者", "张三");//存打印的图数据Hashtable<String, String> printImgMap = new Hashtable<>();printImgMap.put("RPC", "http://localhost:8080/JRTWeb/FileService/zlz/logo.png");//存项目结果数据List<Object> repResList = new ArrayList<>();RepResPrintDto oneRes = new RepResPrintDto();oneRes.AbFlag = "*";oneRes.RefRange = "12-34um/ml";oneRes.Result = "50";oneRes.Seq = "1";oneRes.TestCodeName = "白细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "*";oneRes.RefRange = "12-34um/ml";oneRes.Result = "50";oneRes.Seq = "2";oneRes.TestCodeName = "红细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "";oneRes.RefRange = "12-34um/ml";oneRes.Result = "33";oneRes.Seq = "3";oneRes.TestCodeName = "淋巴细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = "4";oneRes.TestCodeName = "单核细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = "5";oneRes.TestCodeName = "单核细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = "6";oneRes.TestCodeName = "单核细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = "7";oneRes.TestCodeName = "单核细胞计数";repResList.add(oneRes);oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = "8";oneRes.TestCodeName = "单核细胞计数";repResList.add(oneRes);for(int k=9;k<40;k++){oneRes = new RepResPrintDto();oneRes.AbFlag = "↓";oneRes.RefRange = "22-34um/ml";oneRes.Result = "5";oneRes.Seq = String.valueOf(k);oneRes.TestCodeName = "项目"+k;repResList.add(oneRes);}//画图片元素PrintImage(template, retList, printImgMap);//画数据元素PrintData(template, retList, printDataMap);//画标签元素PrintLabel(template, retList);//画线元素PrintLine(template, retList);//画表格元素PrintDataGrid(template, retList, repResList);return Helper.Object2Json(retList);}/*** 输出报告结果** @param template* @param template   模板* @param retList    元素列表* @param repResList 报告结果列表*/private void PrintDataGrid(JRTPrintTemplateDto template, List<PrintElement> retList, List<Object> repResList) throws Exception {for (JRTPrintTemplateEle ele : template.EleList) {//输出表格if (ele.PrintType.equals("DataGrid")) {//得到表格定义GridDto defGrid = (GridDto) Helper.Json2Object(ele.PrintText, GridDto.class);int lastY = PrintDrawProtocol.DrawGrid(retList, defGrid, null, repResList, "ReportRes", this);}}}/*** 输出图片** @param template* @param template     模板* @param retList      元素列表* @param printDataMap 数据哈希*/private void PrintImage(JRTPrintTemplateDto template, List<PrintElement> retList, Hashtable<String, String> printDataMap) {for (JRTPrintTemplateEle ele : template.EleList) {//输出图片if (ele.PrintType.equals("Graph")) {boolean isSign = false;if (ele.PrintFlag.equals("D")) {isSign = true;}String dataField = ele.DataField;if (!ele.DataField.isEmpty() && printDataMap.containsKey(ele.DataField)) {dataField = printDataMap.get(ele.DataField);}PrintElement printEle = PrintDrawProtocol.DrawGraph(ele.PrintX, ele.PrintY, ele.PrintWidth, ele.PrintHeight, dataField, isSign, false);retList.add(printEle);}}}/*** 输出数据** @param template     模板* @param retList      元素列表* @param printDataMap 数据哈希*/private void PrintData(JRTPrintTemplateDto template, List<PrintElement> retList, Hashtable<String, String> printDataMap) {for (JRTPrintTemplateEle ele : template.EleList) {//输出标签if (ele.PrintType.equals("Data")) {String dataFiled = ele.DataField;if (!dataFiled.isEmpty() && printDataMap.containsKey(dataFiled)) {//带字的条码if (ele.PrintFlag.contains("BarCode")) {String BarType = ele.PrintFlag.replace("BarCode", "");PrintElement printEle = PrintDrawProtocol.DrawBarCode(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), true, ele.PrintWidth, ele.PrintHeight, BarType, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, ele.Angle);retList.add(printEle);}//不带字的条码else if (ele.PrintFlag.contains("BarCodeN")) {String BarType = ele.PrintFlag.replace("BarCodeN", "");PrintElement printEle = PrintDrawProtocol.DrawBarCode(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), false, ele.PrintWidth, ele.PrintHeight, BarType, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, ele.Angle);retList.add(printEle);}//画普通数据else {PrintElement printEle = PrintDrawProtocol.DrawLabel(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, "", ele.Angle);retList.add(printEle);}}}}}/*** 输出标签** @param template* @param retList*/private void PrintLabel(JRTPrintTemplateDto template, List<PrintElement> retList) {for (JRTPrintTemplateEle ele : template.EleList) {//输出标签if (ele.PrintType.equals("Label")) {PrintElement printEle = PrintDrawProtocol.DrawLabel(ele.PrintX, ele.PrintY, ele.PrintText, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, "", ele.Angle);retList.add(printEle);}}}/*** 输出线** @param template* @param retList*/private void PrintLine(JRTPrintTemplateDto template, List<PrintElement> retList) {for (JRTPrintTemplateEle ele : template.EleList) {//输出先if (ele.PrintType.equals("ILineN")) {int width = ele.PrintWidth;int height = ele.PrintHeight;int endX = ele.PrintX + width;int endY = ele.PrintY;int lineWidth = height;if (height > width) {endX = ele.PrintX;endY = ele.PrintY;lineWidth = width;}PrintElement printEle = PrintDrawProtocol.DrawLine(ele.PrintX, ele.PrintY, endX, endY, lineWidth, ele.PrintFlag, ele.Color);retList.add(printEle);}}}/*** 通过模板主键或者代码得到模板数据供打印使用** @param rowID* @param code* @return*/private JRTPrintTemplateDto GetOneTemplate(Integer rowID, String code) throws Exception {JRTPrintTemplateDto retDto = null;//按主键取if (rowID != null) {retDto = EntityManager().GetById(JRTPrintTemplateDto.class, rowID);}//按代码取else if (code != null && !code.isEmpty()) {retDto = EntityManager().GetByColVal(JRTPrintTemplateDto.class, "Code", code);}if (retDto != null) {HashParam hs = new HashParam();hs.Add("PrintTemplateDR", retDto.RowID);retDto.EleList = EntityManager().FindAllSimple(JRTPrintTemplateEle.class, hs);}return retDto;}/*** 存获得的一个模板数据*/public static class JRTPrintTemplateDto extends JRTPrintTemplate {/*** 模板元素*/public List<JRTPrintTemplateEle> EleList;}/*** 打印的报告结果实体*/public static class RepResPrintDto {/*** 序号*/public String Seq;/*** 项目名称*/public String TestCodeName;/*** 结果*/public String Result;/*** 标志*/public String AbFlag;/*** 参考范围*/public String RefRange;}
}

界面代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>JRTPrintTemplateEle供拷贝代码使用</title><link rel="shortcut icon" href="../../resource/common/images/favicon.ico" /><script src="../../resource/common/js/JRTBSBase.js" type="text/javascript"></script><script src="../../jrtprint/js/JRTPrint.js" type="text/javascript"></script><script language="javascript" type="text/javascript">SYSPageCommonInfo.Init();var BasePath = '';var ResourcePath = '';var WebServicAddress = SYSPageCommonInfo.Data.WebServicAddress;var UserDR = SYSPageCommonInfo.Data.Sesssion.UserDR;var WorkGroupDR = SYSPageCommonInfo.Data.Sesssion.WorkGroupDR;var sysTheme = SYSPageCommonInfo.Data.Sesssion.Theme;var SessionStr = SYSPageCommonInfo.Data.SessionStr;</script><script type="text/javascript">//全局变量var me = {actionUrl: '../ashx/ashJRTPrintTemplateEle.ashx'};//jquery入口$(function () {//导出Excel$("#btnExport").click(function () {var para = {};var tempPath = DealExportExcelTMPName("打印元素.xls");JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');});//导出Excel多模板$("#btnExport1").click(function () {var para = {};var tempPath = DealExportExcelTMPName("打印元素多模板");JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');});//导出Excel无模板$("#btnExport0").click(function () {var para = {};var tempPath = "";JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');});//打印预览$("#btnPrintPreview").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PrintPreview";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";JRTBasePrint(Param);});//打印表格$("#btnPrintPreviewGrid").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PrintOut";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.DrawGrid@GetData";JRTBasePrint(Param);});//打印报告$("#btnPrintReport").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PrintOut";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintTemplateTest@GetData";JRTBasePrint(Param);});//集中打印$("#btnCenterPrint").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PrintOut";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.CenterPrintTest@GetData";JRTBasePrint(Param);});//在线预览$("#btnPrintPreviewInline").click(function () {showwin("#winPrintPreview", "在线打印预览", '../../facade/form/frmJRTPrintDrawView.aspx?PrintDR=' + 1 + '&PrintClassName=vm.test.PrintBarCodeTest', 950, $(window).height() - 20, true, "10px");});//打印$("#btnPrint").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PrintOut";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";JRTBasePrint(Param);});//PDF$("#btnPDF").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PDF#-1";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";JRTBasePrint(Param);});//PDF弹窗$("#btnPDFSave").click(function () {//0:打印所有报告 1:循环打印每一份报告var printFlag = "0";var userCode = "";//打印参数var paramList = "";//PrintOut:打印  PrintPreview打印预览var printType = "PDF#0";var printPara = "1";var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";JRTBasePrint(Param);});//上传文件到文件服务$("#btnUpfile").click(function () {$("#file_upload").click();});//改名文件$("#btnRenamefile").click(function () {//往后台提交数据$.ajax({type: "post",dataType: "json",cache: false, //async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asirurl: me.actionUrl + '?Method=ReNameImageFile',success: function (data, status) {$.messager.progress('close');if (!FilterBackData(data)) {return;}alert("成功");}});});//删除文件$("#btnDeletefile").click(function () {//往后台提交数据$.ajax({type: "post",dataType: "json",cache: false, //async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asirurl: me.actionUrl + '?Method=DeleteImageFile',success: function (data, status) {$.messager.progress('close');if (!FilterBackData(data)) {return;}alert("成功");}});});//新增数据点击$("#btnAddJRTPrintTemplateEle").click(function () {$("#txtJRTPrintTemplateEleRowID").val(""); $('#winEditJRTPrintTemplateEle').window({title: TranslateDataMTHD('Add Data', '新增数据', ''),modal: true});});//修改数据点击$("#btnUpdateJRTPrintTemplateEle").click(function () {UpdateJRTPrintTemplateEle();});//修改数据function UpdateJRTPrintTemplateEle(row){var selectRow = $('#dgJRTPrintTemplateEle').datagrid("getSelected");if(row!=null){selectRow=row;}if (selectRow == null) {$.messager.alert(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Please select the data to modify', '请选择要修改的数据!', ''), 'info');return;}$("#formJRTPrintTemplateEle").form('load', selectRow);$('#winEditJRTPrintTemplateEle').window({title: TranslateDataMTHD('Update Data', '修改数据', ''),modal: true});}//删除数据点击$("#btnDeleteJRTPrintTemplateEle").click(function () {var checkRow = $('#dgJRTPrintTemplateEle').datagrid("getChecked");var selectRow = $('#dgJRTPrintTemplateEle').datagrid("getSelected");if ((checkRow == null || checkRow.length == 0)&&selectRow==null) {$.messager.alert(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Please select the data to delete', '请勾选要删除的数据!', ''), 'info');return;}if ((checkRow == null || checkRow.length == 0)) {checkRow=[selectRow];}var RowIDS = "";for (var i = 0; i < checkRow.length; i++) {if (i == 0) {RowIDS = checkRow[i].RowID;}else {RowIDS += "^" + checkRow[i].RowID;}}$.messager.confirm(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Do you want to delete the selected data', '是否要删除选择的数据?', '') , function (r) {if (r) {//开启等待$.messager.progress({ text: TranslateDataMTHD("Deleting data","正在删除数据", ""), interval: 500 });setTimeout(function () {$.messager.progress('close');}, 8000);//往后台提交数据$.ajax({type: "post",dataType: "json",cache: false, //async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asirurl: me.actionUrl + '?Method=DeleteJRTPrintTemplateEle',data: { RowIDS: RowIDS },success: function (data, status) {$.messager.progress('close');if (!FilterBackData(data)) {return;}if (!data.IsOk) {$.messager.alert(TranslateDataMTHD("Error message", "错误提示", ""), TranslateDataMTHD("failed to dalete data, error message:", "删除失败,错误信息:", "") + data.Message);}else {QryJRTPrintTemplateEle();$.messager.show({title: TranslateDataMTHD("Info", "提示", ""),msg: TranslateDataMTHD("Successfully deleted!", "删除成功!", ""),timeout: 500,showType: 'slide'});}}});}});});//保存数据$("#btnSaveJRTPrintTemplateEle").click(function () {var saveData = jQuery.parseJSON($("#formJRTPrintTemplateEle").serializeObject());//开启等待$.messager.progress({ text: TranslateDataMTHD("Saving data","正在保存数据", ""), interval: 500 });setTimeout(function () {$.messager.progress('close');}, 8000);//往后台提交数据$.ajax({type: "post",dataType: "json",cache: false, //async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asirurl: me.actionUrl + '?Method=SaveJRTPrintTemplateEle',data: saveData,success: function (data, status) {$.messager.progress('close');if (!FilterBackData(data)) {return;}if (!data.IsOk) {$.messager.alert(TranslateDataMTHD("Error message", "错误提示", ""), TranslateDataMTHD("failed to dalete data, error message:", "删除失败,错误信息:", "") + data.Message);}else {QryJRTPrintTemplateEle();$.messager.show({title: TranslateDataMTHD("Info", "提示", ""),msg: TranslateDataMTHD("Successfully saveed!", "保存成功!", ""),timeout: 500,showType: 'slide'});$('#winEditJRTPrintTemplateEle').window("close");}}});});//关闭窗口$("#btnCloseJRTPrintTemplateEle").click(function () {$('#winEditJRTPrintTemplateEle').window("close");});//构造查询事件$("#txtFilterJRTPrintTemplateEle").searchbox({searcher: function (value, name) {QryJRTPrintTemplateEle();},prompt: TranslateDataMTHD('Enter query', '回车查询', '')});//模板下拉表格渲染$('#txtJRTPrintTemplateElePrintTemplateDR').combogrid({panelWidth: 350,idField: 'RowID',width: 205,textField: 'CName',url: me.actionUrl + '?Method=CommonQueryView&data='+JSON.stringify({ ModelName: "JRTPrintTemplate", Pram: [], IsDisplayCount: false, Joiner: [], Operators: [] }),columns: [[{ field: 'RowID', title: '主键', width: 60 },{ field: 'CName', title: '名称', width: 260 }]]});$('#txtJRTPrintTemplateElePrintTemplateDR').combogrid("showSelectWin");//JRTPrintTemplateEle表格$('#dgJRTPrintTemplateEle').datagrid({remoteSort:false,singleSelect: true,toolbar: "#dgJRTPrintTemplateEleToolBar",fit: true,onSelect: function (index, row) {//方便拷贝到子表查询用var selectJRTPrintTemplateEle=$('#dgJRTPrintTemplateEle').datagrid("getSelected");},onDblClickRow: function (index, row) {UpdateJRTPrintTemplateEle(row);},columns: [[{ field: 'ChkFlag', title: TranslateDataMTHD('Check', '选择', ''), width: 20, sortable: true, align: 'center', checkbox: true },{ field: 'RowID', title: TranslateDataMTHD('RowID', '主键', '') , width: 150, sortable: true },{ field: 'PrintTemplateDRName', title: TranslateDataMTHD('PrintTemplateDRName', '模板', '') , width: 150, sortable: true },{ field: 'PrintType', title: TranslateDataMTHD('PrintType', '元素类型', '') , width: 150, sortable: true },{ field: 'PrintX', title: TranslateDataMTHD('PrintX', 'X坐标', '') , width: 150, sortable: true },{ field: 'PrintY', title: TranslateDataMTHD('PrintY', 'Y坐标', '') , width: 150, sortable: true },{ field: 'PrintFont', title: TranslateDataMTHD('PrintFont', '打印字体', '') , width: 150, sortable: true },{ field: 'PrintFontSize', title: TranslateDataMTHD('PrintFontSize', '打印字体大小', '') , width: 150, sortable: true },{ field: 'PrintFontStyle', title: TranslateDataMTHD('PrintFontStyle', '打印字体样式', '') , width: 150, sortable: true },{ field: 'PrintLength', title: TranslateDataMTHD('PrintLength', '打印长度', '') , width: 150, sortable: true },{ field: 'PrintWidth', title: TranslateDataMTHD('PrintWidth', '元素宽度', '') , width: 150, sortable: true },{ field: 'PrintHeight', title: TranslateDataMTHD('PrintHeight', '元素高度', '') , width: 150, sortable: true },{ field: 'PrintText', title: TranslateDataMTHD('PrintText', '元素文本', '') , width: 150, sortable: true },{ field: 'DataField', title: TranslateDataMTHD('DataField', '绑定属性', '') , width: 150, sortable: true },{ field: 'PrintFlag', title: TranslateDataMTHD('PrintFlag', '特殊标志', '') , width: 150, sortable: true },{ field: 'PrintAlignment', title: TranslateDataMTHD('PrintAlignment', '停靠方向', '') , width: 150, sortable: true },{ field: 'LayOut', title: TranslateDataMTHD('LayOut', '布局方式', '') , width: 150, sortable: true },{ field: 'Angle', title: TranslateDataMTHD('Angle', '旋转角度', '') , width: 150, sortable: true },{ field: 'IsVShow', title: TranslateDataMTHD('IsVShow', '是否垂直显示', '') , width: 150, sortable: true },{ field: 'Color', title: TranslateDataMTHD('Color', '颜色', '') , width: 150, sortable: true },{ field: 'FixedReport', title: TranslateDataMTHD('FixedReport', '固定元素', '') , width: 150, sortable: true }]]});//查询JRTPrintTemplateElefunction QryJRTPrintTemplateEle() {var Filter = $("#txtFilterJRTPrintTemplateEle").searchbox("getValue");//开启等待,默认注释,在单击事件调用的逻辑启用等待会冲掉双击事件,按需要开启//$.messager.progress({ text: TranslateDataMTHD("Querying data","正在查询数据", ""), interval: 500 });//setTimeout(function () {//$.messager.progress('close');//}, 8000);$.ajax({type: "post",dataType: "json",cache: false, //async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asirurl: me.actionUrl + '?Method=QryJRTPrintTemplateEle',data: { Filter: Filter },success: function (data, status) {//结束等待//$.messager.progress('close');if (!FilterBackData(data)) {return;}$('#dgJRTPrintTemplateEle').datagrid("loadData", data);}});};//执行查询数据QryJRTPrintTemplateEle();});</script>
</head>
<body><div class="easyui-layout" fit="true" style="border: none;"><div data-options="region:'center',title:''" style="border: none;"><div id="dgJRTPrintTemplateEleToolBar" style="padding: 3px 0px 3px 10px;"><a id="btnAddJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" plain="true" listranslate="html~Add">新增</a><a id="btnUpdateJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-write-order'" plain="true" listranslate="html~Mod">修改</a><a id="btnDeleteJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" plain="true" listranslate="html~Del">删除</a><input id="txtFilterJRTPrintTemplateEle" style="margin-left: 14px; width: 240px;"></input><a id="btnExport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出</a><a id="btnExport1" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出多模板</a><a id="btnExport0" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出无模板</a><a id="btnPrintPreview" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintPreview">打印预览</a><a id="btnPrintPreviewInline" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintPreview">在线预览</a><a id="btnPrint" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~Print">打印</a><a id="btnPDF" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PDF">PDF</a><a id="btnPDFSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PDF">PDF弹</a><a id="btnPrintPreviewGrid" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintGrid">打表格</a><a id="btnPrintReport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintReport">打报告</a><a id="btnCenterPrint" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~CenterPrint">集中打印</a><a id="btnUpfile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">上传文件</a><a id="btnRenamefile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">改名</a><a id="btnDeletefile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">删除</a></div><table id="dgJRTPrintTemplateEle" title="" iconcls="icon-paper" listranslate="title~JRTPrintTemplateEle"></table></div><div id="winEditJRTPrintTemplateEle" style="padding: 10px 0px 0px 10px;width:1140px;height:366.6666666666666667px;display: none;"><form id="formJRTPrintTemplateEle" name="edit_form" method="post"><input type="hidden" id="txtJRTPrintTemplateEleRowID" name="RowID" value="0" /><table><tr><td class="lisar" jrttranslate="html~PrintTemplateDR">模板</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintTemplateDR" type="text" name="PrintTemplateDR" style="width:200px;"/></td><td class="lisar" jrttranslate="html~PrintType">元素类型</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintType" type="text" name="PrintType" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td><td class="lisar" jrttranslate="html~PrintX">X坐标</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintX" type="text" name="PrintX" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td></tr><tr><td class="lisar" jrttranslate="html~PrintY">Y坐标</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintY" type="text" name="PrintY" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~PrintFont">打印字体</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintFont" type="text" name="PrintFont" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td><td class="lisar" jrttranslate="html~PrintFontSize">打印字体大小</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintFontSize" type="text" name="PrintFontSize" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td></tr><tr><td class="lisar" jrttranslate="html~PrintFontStyle">打印字体样式</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintFontStyle" type="text" name="PrintFontStyle" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td><td class="lisar" jrttranslate="html~PrintLength">打印长度</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintLength" type="text" name="PrintLength" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~PrintWidth">元素宽度</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintWidth" type="text" name="PrintWidth" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td></tr><tr><td class="lisar" jrttranslate="html~PrintHeight">元素高度</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintHeight" type="text" name="PrintHeight" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~PrintText">元素文本</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintText" type="text" name="PrintText" style="width:200px;" class="easyui-validatebox"  maxlength="2000"/></td><td class="lisar" jrttranslate="html~DataField">绑定属性</td><td class="lisal"><input id="txtJRTPrintTemplateEleDataField" type="text" name="DataField" style="width:200px;" class="easyui-validatebox"  maxlength="500"/></td></tr><tr><td class="lisar" jrttranslate="html~PrintFlag">特殊标志</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintFlag" type="text" name="PrintFlag" style="width:200px;" class="easyui-validatebox"  maxlength="50"/></td><td class="lisar" jrttranslate="html~PrintAlignment">停靠方向</td><td class="lisal"><input id="txtJRTPrintTemplateElePrintAlignment" type="text" name="PrintAlignment" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~LayOut">布局方式</td><td class="lisal"><input id="txtJRTPrintTemplateEleLayOut" type="text" name="LayOut" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td></tr><tr><td class="lisar" jrttranslate="html~Angle">旋转角度</td><td class="lisal"><input id="txtJRTPrintTemplateEleAngle" type="text" name="Angle" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~IsVShow">是否垂直显示</td><td class="lisal"><input id="txtJRTPrintTemplateEleIsVShow" type="text" name="IsVShow" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td><td class="lisar" jrttranslate="html~Color">颜色</td><td class="lisal"><input id="txtJRTPrintTemplateEleColor" type="text" name="Color" style="width:200px;" class="easyui-validatebox"  maxlength="30"/></td></tr><tr><td class="lisar" jrttranslate="html~FixedReport">固定元素</td><td class="lisal"><input id="txtJRTPrintTemplateEleFixedReport" type="text" name="FixedReport" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td></table><div region="south" border="fale" style="text-align: center; padding: 5px 0 0;"><a id="btnSaveJRTPrintTemplateEle" href="#" class="easyui-linkbutton" plain="false" listranslate="html~Save">保存</a><span class="sp6"></span><a id="btnCloseJRTPrintTemplateEle" href="#" class="easyui-linkbutton" plain="false" listranslate="html~Cancel">取消</a></div></form></div><div id="winPrintPreview" style="padding: 10px 0px 0px 10px; width: 1140px; height: 786px; display: none;"></div>
</body>
</html>

通过最近的实践发现逻辑强悍还是赶不上设计强悍,想想以前用M写打印怪考验逻辑的

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/642763.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

工程化代码管理高频面试题

1. git常用命令以及工作中都怎么工作 git init 初始化仓库 ​ git status 查看当前各个区域的代码状态。 ​ git log查看commit记录 ​ git reflog查看完整记录 ​ git add 添加工作区代码到暂存区 ​ Git commit 暂存区代码的提交 ​ git reset 代码的版本回退 ​ git stash …

《WebKit 技术内幕》学习之七(3): 渲染基础

3 渲染方式 3.1 绘图上下文&#xff08;GraphicsContext&#xff09; 上面介绍了WebKit的内部表示结构&#xff0c;RenderObject对象知道如何绘制自己&#xff0c;但是&#xff0c;问题是RenderObject对象用什么来绘制内容呢&#xff1f;在WebKit中&#xff0c;绘图操作被定…

finalshell连接linux的kali系统

kali的ssh服务似乎是默认关闭的&#xff0c;笔者在玩CentOS系统时可以直接用finalshell完成连接&#xff0c;但kali不行&#xff0c;需要先手动开启ssh服务。 开启kali的ssh服务 输入【ssh start】命令开启ssh服务&#xff0c;可以用【ssh status】命令查看ssh状态&#xff0c…

第40集《佛法修学概要》

请大家打开讲义第一百零六页。我们讲到大乘的果位。大乘佛法的修学跟小乘最大的差别&#xff0c;主要在于一句话&#xff0c;就是大乘佛法是一种“称性起修&#xff0c;全修在性”。大乘佛法的功德第一个“称性”&#xff0c;这个“称”就是随顺。我们一念明了的心&#xff0c;…

【数据结构】 链栈的基本操作 (C语言版)

目录 一、链栈 1、链栈的定义&#xff1a; 2、链栈的优缺点&#xff1a; 二、链栈的基本操作算法&#xff08;C语言&#xff09; 1、宏定义 2、创建结构体 3、链栈的初始化 4、链栈的进栈 5、链栈的出栈 6、获取栈顶元素 7、栈的遍历输出 8、链栈的判空 9、求链…

AtCoder Beginner Contest 337 A~G

A.Scoreboard(循环) 题意&#xff1a; 两个队伍进行 N N N场比赛。在第 i i i场比赛中 &#xff08; 1 ≤ i ≤ N &#xff09; &#xff08;1≤i≤N&#xff09; &#xff08;1≤i≤N&#xff09;&#xff0c;两队各得到 X i X_i Xi​和 Y i Y_i Yi​分。比赛结束后总分更高…

BACnet网关BL121BN 实现稳定可靠、低成本、简单的楼宇自控协议BACnet转OPC UA解决方案

随着楼宇自控系统的迅猛发展&#xff0c;人们深刻认识到在楼宇暖通行业中&#xff0c;实时、可靠、安全的数据传输至关重要。在此背景下&#xff0c;高性能的楼宇暖通数据传输解决方案——协议转换网关应运而生&#xff0c;广泛应用于楼宇自控和暖通空调系统应用中。 钡铼技术…

[反转链表] [合并两个有序链表][分割链表]

这里写目录标题 反转链表合并两个有序链表分割链表 反转链表 1、题目&#xff1a; 2.思路  思路1&#xff1a;建立一个newHead,取一个节点进行头插。具体做法如下&#xff01; 建立一个newHead(新头)&#xff0c;由于一个节点里面存的是下一个节点的地址&#xff0c;如果取…

VS2019查看文件编码格式

文件->高级保存选项 在这里可以看见现在的编码格式也可以修改编码格式 如果没有高级保存选项的话可以参考这篇博客进行设置

Vue (v-bind指令、el与data的两种写法、理解MVVM、数据代理、V-no事件处理、双向数据绑定V-model、登陆页面实现

V-bind指令 el与data两种写法 MVVM 数据代理 V-no事件处理 V-no用于监听DOM对象 双向数据绑定V-model v-model 指令用来在 input、select、textarea、checkbox、radio 等表单控件元素上创建双向数据绑定&#xff0c;根据表单上的值&#xff0c;自动更新绑定的元素的值。 按钮的…

激光雷达行业梳理1-概述、市场、技术路线

激光雷达作为现代精确测距和感知技术的关键组成部分&#xff0c;在近几年里取得了令人瞩目的发展。作为自动驾驶感知层面的重要一环&#xff0c;相较摄像头、毫米波雷达等其他传感器具有“ 精准、快速、高效作业”的巨大优势&#xff0c;已成为自动驾驶的主传感器之一&#xff…

网络安全的概述

网络空间的概念 2003年美国提出网络空间的概念&#xff1a;一个由信息基础设施组成的互相依赖的网络。 我国官方文件定义&#xff1a;网络空间为继海&#xff0c;陆&#xff0c;空&#xff0c;天以外的第五大人类活动领域 网络安全发展历史 通信保密阶段 --- 计算机安全阶段…

API接口安全总结

接口分类 HTTP接口 RPC接口&#xff08;客户端和服务器端的连接 例如游戏登陆&#xff09;非web协议&#xff0c;PRC 远程过程调用 Remote Procedure Call&#xff0c;其就是一个节点请求另外一个节点提供的服务。当两个物理分离的子系统需要建立逻辑上的关联时&#xff0c;R…

1 认识微服务

1.认识微服务 随着互联网行业的发展&#xff0c;对服务的要求也越来越高&#xff0c;服务架构也从单体架构逐渐演变为现在流行的微服务架构。这些架构之间有怎样的差别呢&#xff1f; 1.0.学习目标 了解微服务架构的优缺点 1.1.单体架构 单体架构&#xff1a;将业务的所有…

k8s集群异常恢复

前提、我自己的k8s采用的是单master节点两个从节点部署&#xff0c;我针对单master情况进行恢复说明 场景一&#xff1a;正常开关虚拟机&#xff0c;可直接重启kubelet进行恢复 1、1、一般重启后三个节点都需要检查&#xff0c;输入命令检查kubelet&#xff1a; systemctl s…

时限挑战——深度解析Pytest插件 pytest-timeout

在软件开发中,测试用例的执行时间通常是一个关键考虑因素。Pytest插件 pytest-timeout 提供了一个强大的插件,允许你设置测试用例的超时时间。本文将深入介绍 pytest-timeout 插件的基本用法和实际案例,助你精确掌控测试用例的执行时限。 什么是pytest-timeout? pytest-tim…

python环境安装sklearn及报错解决

安装 如刚开始安装&#xff0c;还未遇到问题请直接从重新安装库开始看&#xff0c;如果遇到报错&#xff0c;从问题开始看 问题 python安装sklearn报错 &#xff0c;报错信息如下 File "<stdin>", line 1pip install scikit-learn^ SyntaxError: invalid s…

第7章 7.6.5 常量指针 Page406~407

const可以限制指针指向的数据&#xff0c;也可以限制指针的指向 const限制指针指向的数据&#xff0c;不可以修改指向的数据&#xff0c;可以改变指向 推荐写法 常见写法&#xff1a;

用Excel辅助做数独

做数独游戏的时候&#xff0c;画在纸上很容易弄花眼&#xff0c;所以我考虑用Excel辅助做一个。 界面如下&#xff1a; 按下初始化表格区域按钮&#xff0c;会在所有单元格中填充“123456789”。如下图&#xff1a; 当某个单元格删除得只剩一个数字时&#xff0c;会将同一行、…

《大型语言模型自然语言生成评估》综述

在快速发展的自然语言生成&#xff08;NLG&#xff09;评估领域中&#xff0c;引入大型语言模型&#xff08;LLMs&#xff09;为评估生成内容质量开辟了新途径&#xff0c;例如&#xff0c;连贯性、创造力和上下文相关性。本综述旨在提供一个关于利用LLMs进行NLG评估的全面概览…