请上传宽度大于 1200px,高度大于 164px 的封面图片
    调整图片尺寸与位置
    滚轮可以放大缩小图片尺寸,按住图片拖动可调整位置,多余的会自动被裁剪掉
取消
SingingTowers(uid:362471)
职业资格认证:FCP-报表开发工程师
FineReport 11 解析报表模板文件获取模板的数据集和SQL语句
解析报表模板文件获取模板的数据集和SQL语句,并保存为Excel   完整代码 import json import pandas as pd from lxml import etree import os result_li = for root, dirs, files in os.walk(".\\reportlets", topdown=False): for name in files: abs_name = os.path.join(os.path.abspath(root), name) # fineReport .cpt .frm 本身是xml文件,故可直接按行匹配字符查找是否与对象有关 if abs_name not in : continue # 打开.cpt .frm with open(abs_name, mode="rb") as fr: xslt_content = fr.read() xml_root = etree.XML(xslt_content) tabel_data_el = xml_root.xpath("//*/TableDataMap//TableData") for db_data in tabel_data_el: # 数据集名称 date_source_name = db_data.get("name") # 转 string string = etree.tostring(db_data, encoding='utf-8').decode('utf-8') data_source = etree.XML(string) conn = data_source.xpath("/TableData/Connection/DatabaseName/text()") conn_collect = for j in conn: # 数据链接名字 conn_collect.append(str(j).strip()) conn_string = "".join(conn_collect) query = data_source.xpath("/TableData/Query/text()") query_collect = for j in query: # 数据集SQL query_collect.append(str(j).strip()) query_string = "".join(query_collect) data_source_json = { "report": abs_name, "data_source": date_source_name, "conn": conn_string, "query": query_string } result_li.append(data_source_json) print(json.dumps(data_source_json, ensure_ascii=False)) print("-----------------------------------") df = pd.DataFrame(result_li) df.to_excel("./data_source.xlsx", engine="openpyxl", index=False)
【FineDB】批量查询导出人员目录及模板权限
我们可以通过【管理系统】查看单个人员对应的目录权限,并且无法导出,但是我们可以通过FineDB表结构以及表之间的关系使用SQL导出,以下是Oracle 语法FineDB查询表与角色和人员关系的SQL语句 select id,path,parent2,parent3,parent4,displayname,nvl(max(authority_r), 'N') authority_r,nvl(max(authority_w), 'N') authority_w,role_name,role_category,realname,usernamefrom (select a.id,cast(a.path as varchar(100)) path,c.DISPLAYNAME parent2,d.DISPLAYNAME parent3,e.DISPLAYNAME parent4,a.DISPLAYNAME,FINE_AUTHORITY.AUTHORITY,decode(cast(FINE_AUTHORITY.AUTHORITYTYPE as number), 1, 'Y', null) AUTHORITY_R,decode(cast(FINE_AUTHORITY.AUTHORITYTYPE as number), 3, 'Y', null) AUTHORITY_W,role_name,role_category,FINE_USER.REALNAME,FINE_USER.USERNAME from (select id,path,DISPLAYNAME,substr(FULLPATH, instr(FULLPATH, '-_-', 1, 1) + 3,instr(FULLPATH, '-_-', 1, 2) - 3 - instr(FULLPATH, '-_-', 1, 1)) p2,case when instr(FULLPATH, '-_-', 1, 3) > 0 then substr(FULLPATH, instr(FULLPATH, '-_-', 1, 2) + 3,instr(FULLPATH, '-_-', 1, 3) - 3 -instr(FULLPATH, '-_-', 1, 2))else substr(FULLPATH, instr(FULLPATH, '-_-', 1, 2) + 3,length(FULLPATH) - 2 - instr(FULLPATH, '-_-', 1, 2)) end p3,case when instr(FULLPATH, '-_-', 1, 3) > 0 then substr(FULLPATH, instr(FULLPATH, '-_-', 1, 3) + 3,length(FULLPATH) - 2 -instr(FULLPATH, '-_-', 1, 3)) end p4 from FINE_AUTHORITY_OBJECT where 1=1 -- 报表模板路径-- and path like '01/07/%' -- 报表目录名称-- and DISPLAYNAME like '%周期%' ) a left join (select id,DISPLAYNAME from FINE_AUTHORITY_OBJECT) c on a.p2 = c.id left join (select id,DISPLAYNAME from FINE_AUTHORITY_OBJECT) d on a.p3 = d.id left join (select id,DISPLAYNAME from FINE_AUTHORITY_OBJECT) e on a.p4 = e.id left join (select id,authority,AUTHORITYTYPE,AUTHORITYENTITYID,ROLEID from FINE_AUTHORITY) FINE_AUTHORITY on a.ID = FINE_AUTHORITY.AUTHORITYENTITYID left join (select id,REALNAME,UserName,'' role_name,'user' role_category from FINE_USER union select distinct FINE_CUSTOM_ROLE.id,FINE_USER.REALNAME,FINE_USER.UserName,FINE_CUSTOM_ROLE.name,'role' role_category from (select id,name from FINE_CUSTOM_ROLE) FINE_CUSTOM_ROLE inner join (select id, ROLEID, UserID from FINE_USER_ROLE_MIDDLE) FINE_USER_ROLE_MIDDLE on FINE_CUSTOM_ROLE.id = FINE_USER_ROLE_MIDDLE.ROLEID inner join (select id,REALNAME,UserName from FINE_USER) FINE_USER on FINE_USER_ROLE_MIDDLE.userID = FINE_USER.id) FINE_USER on FINE_AUTHORITY.ROLEID = FINE_USER.ID) dw_rolewhere (AUTHORITY_R is not null or AUTHORITY_W is not null)and AUTHORITY = 2group by id,path,parent2,parent3,parent4,displayname,role_name,role_category,realname,usernameorder by parent2,parent3,parent4
个人成就
内容被浏览3,155
加入社区4年96天
返回顶部