如何对Ureport源码启动以及进行二次开发流程记录

  1. 如何对Ureport源码启动以及进行二次开发流程记录

**
一、启动UReport 2 V2.2.9
二、增加不依附于单元格的浮动图片
三、增加不依附于单元格的浮动(直)线段【新增】

  1. 运行后图片
    在这里插入图片描述
    在这里插入图片描述

在这里插入图片描述
代码修改记录
java修改

public class NoneExpandBuilder implements CellBuilder {

	@Override
	public Cell buildCell(List<BindData> dataList, Cell cell, Context context) {
		if(dataList.size()==1){
			BindData bindData=dataList.get(0);
			cell.setData(bindData.getValue());
			cell.setFormatData(bindData.getLabel());
			cell.setBindData(bindData.getDataList());
		}else{
			Object obj=null;
			List<Object> bindData=null;
			for(BindData data:dataList){
				if(obj==null){
					if(data.getLabel()==null){
						obj=data.getValue();					
					}else{
						obj=data.getLabel();										
					}
				}else{
					if(data.getLabel()==null){
						obj=obj+","+data.getValue();					
					}else{
						obj=obj+","+data.getLabel();					
					}
				}
				bindData=data.getDataList();
			}
			cell.setData(obj);
			cell.setBindData(bindData);
		}
		List<ConditionPropertyItem> conditionPropertyItems=cell.getConditionPropertyItems();
		if(conditionPropertyItems!=null && conditionPropertyItems.size()>0){
			context.getReport().getLazyComputeCells().add(cell);
		}else{
			cell.doFormat();
			cell.doDataWrapCompute(context);
		}
		return cell;
	}
}

JavaScript修改


export default class PrintLine{
    constructor(context){
        context.printLine=this;
        this.context=context;
        const height=$(window).height()-90;
        const rightHr=$(`<hr title="打印线" class="ureport-right-hr-for-print" style="height: ${height}px;width:0px;border-left:dashed 1px #999999;position: absolute;left: 300pt;top: 35px;z-index: 10">`);
        $(document.body).append(rightHr);
        this.refresh();
    }
    refresh(){
        const paper=this.context.reportDef.paper;
        const orientation=paper.orientation;
        let width=paper.width;
        if(orientation==='landscape'){
            width=paper.height;
        }
        width=width-paper.leftMargin-paper.rightMargin+38;
        window.pageWidthcw = width;
        $('.ureport-right-hr-for-print').css('left',width+"pt");
    }
};
export default class FileInfo{
    setFile(name){
        if(!this.fileInfo){
            this.fileInfo=$(`<div style="float: right;font-size: 12px;color: #009688;margin-top: 8px;margin-right: 5px"></div>`);
            $('.ud-toolbar').append(this.fileInfo);
        }
        let suffix='.ureport.xml';
        let pos=name.indexOf(suffix);
        if(pos>-1){
            name=name.substring(0,pos);
        }
        name=decodeURI(decodeURI(name));
        this.fileInfo.html('报表:'+name);
    }
};

CSS修改

.handsontable tr{
    background: transparent;
}
.handsontable td, .handsontable th{
    background: transparent;
}
.handsontable table.htCore{
    border-collapse:collapse
}
.ud-toolbar{
    width: 100%;
    background: #f8f8f8;
}
.ud-property-panel{
    width: 406px;
    border: solid 1px #999;
    border-radius: 5px;
    top: 35px;
    left: 710px;
    z-index: 105;
    position: absolute;
    background: #ffffff;
    box-shadow: 5px 5px 5px #888888;
}
.ud-select-color{
    background: #000000;
    width: 14px;
    height: 4px;
    display: block;
}
.ud-select-bgcolor{
    background: #fff;
    width: 14px;
    height: 4px;
    display: block;
}

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

csdn210333430

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值