ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:275.77KB ,
资源ID:4316021      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4316021.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(用友UAP报表高级开发之输出事件.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

用友UAP报表高级开发之输出事件.docx

1、用友UAP报表高级开发之输出事件 报表输出事件1.原理运用.net动态编译原理,所以语法上完全遵守c#语法规则,写的代码要在运行时期取编译运行的2.执行时间加载完数据和个时候,要呈现前把该脚本功能应用上3.报表元数据组成:C#标准语法和报表中已经存在的变量组成4.脚本对象:4.1.filter【功能介绍】过滤条件对象,获取过滤条件中的值【对象函数】返回过滤条件区间初始值(编码):string GetValue1(string key);返回过滤条件区间结束值(编码):string GetValue2(string key);返回过滤条件区间初始值(名称): string GetName1(st

2、ring key);返回过滤条件区间结束值(名称):string GetName2(string key);【用例】filter.GetValue1(订单号)4.2.global【功能介绍】全局对象,定义全局变量【对象函数】执行SQL语句:object ExecuteScalar(string sql)执行SQL语句并返回结果:DataSet Execute(string sql)报表中的全局变量:.varent-定义的全局变量【用例】global.ExecuteScalar(select top 1 ccode from SA_Sale);global.A A为报表中定义的全局变量4.3.c

3、urrent 【功能介绍】获取当前行【对象函数】获取当前行的某列(只有get):object currentcolumnname获取当前行的某列:.columnname -列值【用例】current.订单号current订单号定义sb.Append(public class Currentrn); sb.Append(rn); sb.Append(private RowData _rowdata;rn); sb.Append(public Current(RowData rowdata)rn); sb.Append(rn); sb.Append(_rowdata=rowdata;rn); sb

4、.Append(rn); sb.Append(public object thisstring namern); sb.Append(rn); sb.Append(getrn); sb.Append(rn); sb.Append(return _rowdataname;rn); sb.Append(rn); sb.Append(setrn); sb.Append(rn); sb.Append(_rowdataname=value;rn); sb.Append(rn); sb.Append(rn);4.4.privious【功能介绍】获取前一行【对象函数】获取前一行的某列:object prev

5、iouscolumnname获取前一行的某列:.columnname -列值【用例】previous.订单号previous订单号【功能介绍】获取系统参数【对象函数】执行SQL语句:void ExecuteNonQuery(string sql)执行SQL语句,返回结果:object ExecuteScalar(string sql)执行SQL语句,返回结果:DataSet Exec(string sql)在Meta库中执行SQL语句,返回结果:DataSet ExecFromMeta(string sql)用户名:string UserName当前日期:string Date当前时间:str

6、ing Time当前年:int Year当前月:int Month当前日:int Day帐套年:int AccountYear帐套月:int AccountMonth用户自定义参数:string CusDefineInfo(string key)公司信息:string CompanyInfo(string key)【用例】datahelper.CusDefineInfo(存货.自定义项1)4.5.args【功能介绍】传递参数【对象函数】取参数对象:object thisstring key取参数对象:object GetValue(string key);【用例】argsfilterflag4

7、.6.indexs【功能介绍】分组索引【对象函数】startindex -每一分组的开始序号endindex -每一分组的结束序号currentindex -当前序号4.7.groups【功能介绍】分组函数,获取报表的分组情况及指定分组【对象函数】取指定分组:Group thisint index 取分组级次:int Levelsget;取此组的分组数:int Countget;4.8.currenggoup【功能介绍】分组函数,获取当前组信息【对象函数】获取分组:string thisstring name 获取下级分组:Groups ChildGroups获取上级分组:Group Pare

8、nt 分组的可见性:bool Visible 分组的级次:int Level4.9.Cells【功能介绍】字段组函数,获取指定字段【对象函数】获取指定列:Cell thisstring namecell.Caption=cellscInvCode.ToString();4.10.Report【功能介绍】报表对象,获取报表信息【对象函数】获取报表的分组级次:int GroupLevels获取二次过滤条件:string RowFilter.FilterStringstring GroupFilterreportsummaryData【功能介绍】报表汇总对象,获取报表的汇总信息【对象函数】获取指定字

9、段的汇总数:Double thisstring mapname【用例】this存货数量5.例子5.1.根据已有内容,动态显示另外一个值比“数据权限查询”报表中的 有权if(cell.Value.ToString().Trim() = 1) cell.Caption=;elsecell.Caption=;5.2.获取当前登陆语言,并且动态显示列名称if(cell.Value.ToString().Trim() = ) if(datahelper.Login.LocaleID.ToLower() = zh-cn) cell.Caption=来源自身; if(datahelper.Login.Loc

10、aleID.ToLower() = zh-tw) cell.Caption=來源自身; if(datahelper.Login.LocaleID.ToLower() = en-us) cell.Caption=Inherit From Self;5.3.根据不同值,显示不同的背景色,起醒目提示作用if (Convert.ToDouble(cell.Value) 100000)cell.ForeColor = Color.Red;效果】销售额字段按上述条件变化背景色;提成额按上述条件设置为红色。5.4.计算逻辑复杂计算列,需要根据上一行内容来动态计算,完全是靠代码写出来的如应付总账表中的余额本币

11、列if( currentindex = 0 ) /current.ye = current.ye+current.jf-current.df-current.jf2+current.df2;else current.ye = previous.ye+current.jf-current.df-current.jf2+current.df2;return current.ye;6.附录(编译后的具体代码)public class CellcWhName:ICellEventpublic void Prepaint(Report report, RowData data, Cell innerce

12、ll, FilterSrv filter, AgileArgs args, DataHelper datahelper, ReportSummaryData reportsummary, RowBalance rowbalance, AccumulateData accumulate, BalanceData balance,object others) Current current=null; int grouplevels=report.GroupLevels; int currentindex=-1; int startindex=-1; Groups groups=null; Gro

13、up currentgroup=null; RowData columntodata=null; Current previous=new Current(rowbalance); if(rowbalance !=null ) currentindex=rowbalance.CurrentIndex; startindex=rowbalance.StartIndex; SemiRow cells=(data!=null?data.SemiRow:null); SemiRow row=cells; IKeyToObject nametodata=cells as IKeyToObject; St

14、imulateCell cell=new StimulateCell(innercell); if(data is Group) cell.bInGroup=true; currentgroup=data as Group; columntodata=currentgroup; else if(!(data is ReportSummaryData) current=new Current(data); columntodata=data; else cell.bInReportSummary=true; columntodata=data; if(nametodata=null) namet

15、odata=columntodata as IKeyToObject; Global global; if (datahelper.Global = null) global = new Global(); global.DataHelper = datahelper; datahelper.Global = global; else global = datahelper.Global as Global; /cell.Caption=current.Function0;/(cellscWhName as Cell).Caption=current.Function0;cell.Caption=cellscInvCode.ToString();cell.Caption=report.GroupLevels;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1