随笔 - 225  文章 - 98  trackbacks - 0
<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

随笔分类

相册

报表工具厂商们

搜索

  •  

最新评论

阅读排行榜

JavaScript需要改进的地方

1)私有方法是不是要统一以"_"(下划线)开头

2)

1.对象函数

Array:

indexOf

remove

String 静态方法:

escape

leftPad

format

String:

       startWith

endWith

Fuction:

       createCallback

createDelegate

createInterceptor

defer

createSequence

2.常态函数

       FR.emptyFn

FR.isArray

       FR.applyStyles

FR.toRE

FR.extend

FR.SessionMgr.get

FR.cjkEncode

FR.cjkDecode

FR.jsonEncode

FR.jsonDecode

       FR.object2String

FR.contains

FR.accDiv

       FR.accMul

FR.accAdd

       FR.accMin

3.UI函数

       FR.showDialog

FR.showIframeDialog

FR.showRemoteDialog

FR.closeDialog

FR.Msg.Alert

FR.Msg.Confirm

FR.Msg.Prompt

4.打印

FR.doURLPDFPrint

FR.doURLAppletPrint

FR.doFlashURLPrint

5.jQuery布局

       __border__

       __grid__

6.组件注册和生产

       FR.comp.reg

       FR.comp.create

7.FR.OB(事件观察者)

       fireEvent

on

       once

       un

       purgeListeners

8.FR.Widget(控件) extends OB

       isEnable

       isVisible

       enable

       disable

9.FR.Form(表单) extends OB

       formSubmit

       getValueByName

       getWidgetByName

       getWidgetByCell

10.FR.BasePane extends Widget

       load

       loadReportPane

       zoom

11.FR.BaseEditor extends Widget

       getValue

setValue

       reset

       isValidate

       getErrorMsg

       startEditing

       stopEditing

12.

FR.FileUploadEditor(文件上传控件) extends BaseEditor

 FR.CheckBoxGroup(复选按钮组控件) extends BaseEditor

 FR.RadioGroup(单选按钮组控件) extends BaseEditor

 FR.ToogleButton extends BaseEditor

       selected

FR.CheckBox extends ToogleButton

FR.Radio extends ToogleButton

FR.TextEditor(文本控件) extends BaseEditor

       selectText

 FR.NumberEditor(数字控件) extends TextEditor

 FR.DateTimeEditor(日期时间控件) extends TextEditor

 FR.TriggerEditor extends TextEditor

       onTriggerClick

FR.ComboBoxEditor(下拉框控件) extends TriggerEditor

       onTriggerClick

setMode

       isExpanded

       expand

       collapse

FR.CheckboxEditor(下拉复选框) extends ComboBoxEditor

FR.TreeComboBoxEditor(下拉树) extends CheckboxEditor

13.

FR.PagePane extends BasePane

       currentPageIndex

       reportTotalPage

   gotoPage

       gotoFirstPage

       gotoLastPage

       gotoPreviousPage

       gotoNextPage

       printReportServer

       emailReport

       pdfPrint

       appletPrint

       flashPrint

       exportReportToPDF

       exportReportToExel

       exportReportToWord

14.

 FR.WritePane extends BasePane

       curLGP

getCellValue

       setCellValue

       stopEditing

       verifyAndWriteReport

       writeReport

       saveReport

       verifyReport

       pdfPrint

       flashPrint

       exportReportToPDF

       exportReportToExcel

       exportReportToWord

       printReportServer

       emailReport

 FR.WLGP(WritePane的逻辑数据处理对象) extends FR.OB

       idx

       getCellValue

       setCellValue

       fireCellValueChange

       isSelectable

       selectTDCell

       editTDCell

       clearCellSelection

       displayTDCell

函数具体介绍:

indexOf

计算一个参数,返回它在数组中的位置,如果不在数组中,则返回-1

语法

       Arr.indexOf(o)

参数

       对象

描述

       indexOfFineReport对数组对象函数的一个扩充

示例

   ["st", "es", "cd", "ds"].indexOf("cd")返回2

   ["st", "es", "cd", "ds"].indexOf("ut")返回-1

 

remove

移除数组对象中一个指定的元素,并返回一个新的数组

语法

       Arr.remove(o)

参数

       对象

描述

       RemoveFineReport对数组对象函数的一个扩充

示例

       ["st", "es", "cd", "ds"].remove("cd")返回["st", "es", "ds"]

    ["st", "es", "cd", "ds"]. remove ("ut")返回["st", "es", "cd", "ds"]

 

String.escape

返回以"\$1"代替"'""\"的字符串

语法

       String.escape(string)

参数

       string:字符串

描述

       String.escapeFineReport自定义的一个函数

示例

 

String.leftPad

返回一个左对齐的字符串

语法

String.leftPad(val, size, [ch])

参数

       val:需要转换的对象;

       size:补齐后总共的产度;

    ch(可选):补齐所用的字符,默认为" "

描述

       String.leftPadFineReport自定义的一个函数

示例

       String.leftPad("FineReport",  20, "left")返回" leftleftleftFineReport"

      

String.format

返回格式化后的字符串

语法

       String.format(str, [val])

参数

       str:需要被格式化的原始字符串

       [val]:可选参数,标识被格式化的样式

描述

String.formatFineReport自定义的一个函数

示例

       var cls = 'my-class', text = 'Some text';

       var s = String.format('<div class="{0}">{1}</div>"', cls, text);

       s等于'<div class="my-class">Some text</div>"'

startWith

判断一个字符串是否以指定的字符串开始

语法

   "finereport".startWith("fine")

参数

字符串

描述

       startWithFineReportString的函数的扩充

示例

"finereport".startWith("fine")返回true

"finereport".startWith("report")返回false

 

endWith

判断一个字符串是否以指定的字符串结束

语法

   "finereport".endWith("report")

参数

字符串

描述

       endWithFineReportString的函数的扩充

示例

"finereport".endWith("fine")返回false

"finereport".endWith("report")返回true

 

createCallback

将多个函数绑定到一个函数

语法

       fun.createCallback(arg1, arg2)

参数

       函数

描述

示例

       var fn = func1. createCallback(arg1, arg2);

       fn() === func1(arg1, arg2);

 

createDelegate

将对象绑定一个在其作用域下的函数,亦可将特定的多个参数,写成数组传入到那个函数中去。可选地,这需要一个参数来指定是否将参数列表传入到参数数组(即arguments,类型为Array)中去。如果这个第三的参数没有传入,数组将是整个的参数列表。

语法

       fun.createDelegate(scope, Array, Number/Boolean)

参数

       scope:作用域

       array:参数数组

       number/boolean:数字或布尔值,用来指定传入参数的个数

描述

示例

var fn = func1.createDelegate(scope, [arg1,arg2], true)

fn(a,b,c) === scope.func1(a,b,c,arg1,arg2);

 

var fn = func1.createDelegate(scope, [arg1,arg2])

fn(a,b,c) === scope.func1(arg1,arg2);

 

var fn = func1.createDelegate(scope, [arg1,arg2], 1)

fn(a,b,c) === scope.func1(a,arg1,arg2,b,c);

 

createInterceptor

指定一个函数在这个函数之前调用。原函数的所有参数都会传入给它。如果它返回false,原函数将不会被调用。作用域的参数可选地使用。

语法

       fun.createInterceptor(fun1, scope)

参数

描述

示例

 

defer

允许你在某一定时间间隔之后执行函数,而且可指定执行所在的作用域,连同多个参数的传入一同被调用。

语法

       fun.defer(Number, scope, Array, Boolean/Number)

参数

描述

示例

 

createSequence

指定一个函数在这个函数之后调用。原函数的所有参数都会传入给它。作用域的参数可选地使用。

语法

fun.createSequence (fun1, scope)

参数

描述

示例

 

FR.emptyFn

返回一个函数体为空的函数

 

FR.isArray

判断一个对象是否是一个数组

语法

   FR.isArray(o)

参数

       o:需要判断的对象

描述

示例

       FR.isArray("abc")返回false

       FR.isArray(["abc"])返回true

 

FR.applyStyles

给一个dom元素设定css

语法

       FR.applyStyles(el, styles)

参数

       el:dom元素

      style:字符串或对象

描述

示例

       FR.applyStyles ($("div"), "color:red")就得到"<div style='color:red'></div>"

       FR.applyStyles ($("div"), {'color': 'red', 'font-size': '14px'})得到"<div style='color:red, font-size:14px'></div>"

 

FR.toRE

将普通字符串转化为表示正则表达式的字符串

语法

       FR.toRE(string)

参数

       string:字符串

描述

示例

       FR.toRE("{abc}")返回"\{abc\}"

 

FR.extend

实现JavaScript类的继承

语法

       FR.extend(ClassA, ClassB, overrides)

参数

       ClassA:需要继承的类;

       ClassB:父类;

       overrides:重写的方法

描述

示例

       FR.extend(ClassA, ClassB, {

              a1:v1

              a2:v2

})

 

FR.SessionMgr.get

根据sessionID生成BasePane

 

FR.cjkEncode

返回对中日韩问做了特殊转换的字符串

语法

       FR.cjkEncode(str)

参数

       str:需要做转换的字符串

描述

示例

       FR.cjkEncode("This is 帆软软件")返回"This is [5e06][8f6f][8f6f][4ef6] "

 

FR.cjkDecode

cjkEncode处理过的字符串转化为原始字符串

语法

       FR.cjkDecode(value)

参数

       value:需要做转换的字符串

描述

示例

       FR.cjkDecode("This is [5e06][8f6f][8f6f][4ef6] ")返回"This is 帆软软件"

 

FR.jsonEncode

返回json格式的字符串

语法

       FR.jsonEncode(o)

参数

       o:需要被转换的对象,可以是Array, String以及Object

描述

示例

       FR.jsonEncode([1, 2, 3, 4])返回"[1,2,3,4]"

 

FR.jsonDecode

json格式的字符串转化为对象

语法

       FR.jsonDecode(value)

参数

       value:字符串

描述

示例

       FR.jsonDecode("[1,2,3,4]")返回[1,2,3,4]

 

FR.object2String

object转换为一个字符串并且以json的格式来写这个字符串

语法

       FR.object2String(o)

参数

       o:需要转换的对象

描述

示例

FR.object2String({text : 'text1', value: 'value1'})返回"{text : 'text1', value: 'value1'}"

 

FR.contains

判断对象c是否包含在对象p中。c,p均为DOM对象

语法

       FR.contains(p, c)

参数

       p:对象1

       c:对象2

描述

示例

 

FR.isAncestor

判断对象p是不是对象c的祖先。c,p均为DOM对象

语法

       FR.isAncestor(p,c)

参数

p:对象1

       c:对象2

描述

示例

 

FR.accDiv

精确除法

语法

       FR.accDiv(arg1, arg2)

参数

       arg1:被除数

       arg2:除数

描述

示例

       FR.accDiv(2.557, 3.6)等于(2557/36)*10^(1-3)

 

FR.accMul

精确乘法

语法

       FR.accMul(arg1, arg2)

参数

       arg1:乘数

       arg2:乘数

描述

示例

       FR.accMul(2.557, 3.6)等于2557*36/10^(3+1)

FR.accAdd

精确加法

 

FR.accMin

精确减法

 

FR.showDialog

显示一个对话框

语法

       FR.showDialog(title, width, height, innerContent)

参数

       title:对话框的标题

       width:对话框的宽度。当width小于0时,会根据内容自适应宽度。

       height:对话框的高度。当height小于0时,会根据内容自适应高度。

       innerContent:对话框的具体内容

描述

示例

 

FR.showIframeDialog

在一个iframe中显示对话框

语法

       FR.showIframeDialog(o)

参数

       o:对话框参数。可以是一个url或者json对象。

描述

示例

       FR.showIframeDialog({url: ' http://www.finereport.com', title: ' FineReport',width: 200, height:400})

 

FR.showRemoteDialog

显示一个异步加载的对话框

语法

       FR.showRemoteDialog(o)

参数

       o:对话框参数。可以是一个url或者json对象。

描述

示例

       FR.showIframeDialog({url: ' http://localhost:8080/WebReport/ReportSever?op=__sources__ ', title: ' FineReport',width: 200, height:400})

 

FR.closeDialog

关闭对话框

语法

       FR.closeDialog()

参数

描述

示例

 

FR.Msg.Alert

windowalert方法的替代实现

语法

       FR.Msg.Alert(title, message, callback)

参数

       title:对话框的的标题

       message:对话框显示的消息

       callback:回调函数

描述

示例

 

FR.Msg.Confirm

确认信息对话框

语法

       FR.Msg.Alert(title, message, callback)

参数

       title:对话框的的标题

       message:对话框显示的消息

       callback:回调函数

描述

示例

 

FR.Msg.Prompt

输入信息对话框

语法

       FR.Msg.Prompt(title, message, value, callback)

参数

       title:对话框的的标题

       message:对话框显示的消息

       value:输入框的默认值

       callback:回调函数

描述

示例

 

FR.doURLPDFPrint

使用PDF打印指定url的报表

语法

       FR.doURLPDFPrint(url, nopopup)

参数

       url:需要使用PDF打印的报表的地址

       nopopup:指定是否需要弹出PDF打印设置对话框。默认为false

描述

示例

 

FR.doURLAppletPrint

使用Applet打印指定url的报表

语法

       FR.doURLAppletPrint(url)

参数

       url:需要使用Applet打印的报表的地址

描述

示例

 

FR.doFlashURLPrint

使用Flash打印指定ur的报表

语法

       FR.doFlashURLPrint(url, currentPageIndex)

参数

       url:需要使用Flash打印的报表的地址

       currentPageIndex:打印的页码

描述

示例

 

__border__

把指定dom元素按东南西北中的方式布局

语法

       __border__(items)

参数

       items:进行boder布局的模块

描述

       是一个JavaScript实现的类似于JavaBorderLayout布局的方法

示例

       $("<div>").appendTo("body").css({height: "100%", width: "100%"}).__boder__([

{region: "north", el: element1},

{region: "center", el:elment2}            

])

 

__grid__

把指定的dom元素按格子分布方式布局

语法

       __grid__(items)

参数

       items:进行grid布局的模块以及高度和宽度

描述

示例

       $('<div>').css({width:'100%', height:'100%'}).appendTo('body').__grid__({

              rows : 2, columns : 2,

              items : [

                     $("<div>").text("no 2").css('height',100).css('overflow', 'hidden'),

                     $("<div>").text("no 3").css('overflow', 'hidden'),

                     $("<div>").text("no 4").css('overflow', 'hidden'),

                     $("<div>").text("no 1").css('overflow', 'hidden')

              ],

              widths : [0, 200], heights:[-1, 100]

       })

 

FR.comp.reg

注册是一个指定type的组件

语法

       FR.comp.reg(type, Class)

参数

       type:要注册的组件的类型

       Class:注册组件的实现类

描述

示例

       FR.comp.reg("page", "$.FR.PagePane")

 

FR.comp.create

在指定dom节点上生成一个组件

语法

       FR.comp.create(el, type, config)

参数

       el:组件将附加到此el

       type:组件的type。需要先注册,参看FR.comp.reg

       config:组件的具体属性

描述

示例

       var $el = $("<div id='comb'></div>").appendTo("body");

       var config = {

              xtype:'combo',

              widgetUrl:'testSource/source.js'

       };

       var com = FR.comp.create($el, "combo", config);

 

fireEvent

触发一个有FR.OB对象定义的事件

语法

       fireEvent(eventName, [args])

参数

       eventName:触发事件的名字

       [args]:可选的参数列表

描述

示例

 

on

FR.OB对象添加一个事件

语法

       on(eventName, fn)

参数

       eventName:添加事件的名字

       fn:该事件的执行函数

描述

示例

 

once

FR.OB对象添加一个仅执行一次的事件

语法

       once(eventName, fn)

参数

       eventName:事件名字

       fn:该事件的执行函数

描述

示例

 

un

从一个FR.OB中移除掉指定事件

语法

       un(eventName, fn)

参数

       eventName:要移除的事件的名字

       fn:要移除的事件的执行函数。如果该值为null,,会把eventName下的所有事件都移除

描述

示例

 

purgeListeners

移除掉一个FR.OB下的所有事件

 

isEnable

判断一个控件是否可用

      

isVisible

判断一个控件是否可见

 

enable

使控件可用

语法

       enable()

参数

描述

示例

 

disable

使控件不可用

语法

       disable()

参数

描述

示例

 

formSubmit

表单提交

语法

    formSubmit(o)

参数

    o:表单提交的对象。该对象为json对象

    o.url:表单提交的地址

    o.asyn:提交的方式。true = 异步提交,false = 同步提交

    o.callback:表单提交的回调函数

    o.data:表单提交的参数

描述

示例

 

getValueByName

根据名字获取表单对象中控件的值

语法

    getValueByName(name)

参数

    name:需要获取值的控件的名字

描述

示例

 

getWidgetByName

很据名字获取表单对象中的控件

语法

    getWidgetByName(name)

参数

    name:根据名字获取控件

描述

示例

 

getWidgetByCell

根据单元格获取控件

语法

    getWidgetByCell(cell)

参数

    cell:单元格位置

描述

示例

    getWidgetByCell("D4")

 

load

加载报表页面(展现、填报)

语法

    load(o)

参数

    o:加载的参数

描述

示例

 

loadReportPane

语法

       loadReportPane(options)

参数

       options:

描述

示例

 

zoom

IE6下的放大镜

语法

       zoom(scale)

参数

       scale:放大或者缩小的倍数

描述

示例

 

getValue

获取编辑器的值

语法

       getValue()

参数

描述

示例

 

setValue

设置编辑器的值

语法

       setValue(value)

参数

       value:需要设置的值

描述

示例

 

reset

重置编辑器的值,设为字符串

 

isValidate

判断当前编辑器的值是否有效

 

getErrorMsg

获取编辑器值无效时的错误信息

 

startEditing

编辑器开始编辑

 

stopEditing

编辑器停止编辑

 

selected

检查button的选中状态或者设置button的选中状态

语法

       selected(bool)

参数

       bool:为为null时返回button的选中状态;否则设置button的选中状态为bool

描述

示例

 

selectText

选取文本编辑器值的指定位置的字符串

语法

       selectText(start, end)

参数

       start:截取的起始位置。默认为0.

       end:截取的结束位置。默认为编辑器值的长度。

描述

示例

 

onTriggerClick

点击trigger图标的事件

 

setMode

设置下拉框的模式,通过该设置可以让下拉框强制重新加载数据。

语法

       setMode(mode)

参数

       mode:模式。' local'——数据已加载,'remote'——数据新加载

 

isExpanded

判断下拉框的下拉菜单是否已经展现

 

expand

打开下拉框的下拉菜单

 

collapse

关闭下拉框的下拉菜单

 

currentPageIndex

全局变量:该ReportPage所属的ReportPage集中的序号

 

reportTotalPage

全局变量:该ReportPage所属的ReportPage集所生成的总的ReportPage的个数

 

gotoPage

将页面跳转到指定页

语法

       gotoPage(num)

参数

       num:大于0的数字

描述

示例

       pagePane.gotoPage(10)

 

gotoFirstPage

页面跳转至首页

语法

       gotoFirstPage()

参数

描述

示例

 

gotoLastPage

页面跳转至最后一页

语法

       gotoLastPage

参数

描述

示例

 

gotoPreviousPage

页面跳转至当前页的上一页

语法

       gotoPreviousPage()

参数

描述

示例

 

gotoNextPage

页面跳转至当前页的下一页

语法

       gotoNextPage()

参数

描述

示例

 

printReportServer

服务器打印

 

emailReport

邮件发送

 

pdfPrint

PDF打印

 

appletPrint

Applet打印

 

flashPrint

Flash打印

 

exportReportToPDF

将报表导出成PDF

语法

       exportReportToPDF(exType)

参数

       exType:导出PDF的方式。

描述

示例

 

exportReportToExel

将报表导出成excel

语法

       exportReportToExcel(exType)

参数

       exType:导出excel的方式。

描述

示例

 

exportReportToWord

将报表导出成word

 

curLGP

变量:填报页面当前的逻辑数据处理对象

 

getCellValue

获取指定格子的值

语法

       getCellValue(reportIndex, columnIndex, rowIndex)

       getCellValue(columnIndex, rowIndex)

参数

       reportIndex:报表索引

columnIndex:列号

rowIndex:行号

描述

示例

 

setCellValue

设置指定格子的值

语法

       setCellValue(reportIndex, columnIndex, rowIndex, cv)

参数

       reportIndex:报表索引

columnIndex:列号

rowIndex:行号

       cv:要设置的值

描述

示例

 

stopEditing

停止当前填报面板的编辑

 

verifyAndWriteReport

在自动校验后才提交报表入库,如果校验失败,则不会入库。

 

writeReport

直接提交报表入库。

 

saveReport

保存报表

语法

       saveReport(fn)

参数

       fn:保存报表后的回调函数

描述

示例

 

verifyReport

校验报表

 

pdfPrint

PDF打印

语法

       pdfPrint(isPopup)

参数

       isPopup:是否弹出PDF打印设置对话框

描述

示例

 

flashPrint

Flash打印

 

exportReportToPDF

将报表导出成PDF

语法

       exportReportToPDF(exType)

参数

       exType:导出方式

描述

示例

 

exportReportToExcel

将报表导出成Excel

语法

       exportReportToExcel(exType)

参数

       exType:导出方式

描述

示例

 

exportReportToWord

将报表导出成Word

 

printReportServer

服务器端打印

 

emailReport

邮件发送

 

idx

变量:报表索引

 

getCellValue

获取指定格子的值

语法

       getCellValue(cr)

getCellValue(col, row)

参数

       cr:行列。例如"D3"

       col:列号

       row:行号

描述

示例

 

setCellValue

设置指定格子的值

语法

       setCellValue(cr, null, cv)

       setCellValue(col, row, cv)

参数

       cr:行列。例如"D3"

       col:列号

       row:行号

       cv:需要设置的值

描述

示例

 

fireCellValueChange

单元格值改变后出发该函数

语法

       fireCellValueChange(tdCell, cv, fm)

参数

       tdCell:该格子所处的td。例如$( "#D3-0")

       cv:该格子的值

       fm:该格子的公式

描述

示例

 

isSelectable

判断该domtdCell是否可被选中

语法

       isSelectable(tdCell)

参数

       tdCell:该格子所处的td。例如$( "#D3-0")

描述

示例

 

selectTDCell

选中dom tdCell。也就是加个黑边框,并确保tdCell在屏幕显示范围内。

语法

       selectTDCell(tdCell)

参数

       tdCell:该格子所处的td。例如$( "#D3-0")

描述

示例

 

editTDCell

编辑dom tdCell

语法

       editTDCell(tdCell)

参数

       tdCell:该格子所处的td。例如$( "#D3-0")

描述

示例

 

clearCellSelection

清除格子的选中状态

 

displayTDCell

把值显示在td里面

语法

       displayTDCell(tdCell, cv)

参数

       tdCell:该格子所处的td。例如$( "#D3-0")

       cv:需要显示的值

描述

示例



了解Java报表工具就从这里开始
posted on 2012-02-29 14:25 season 阅读(1390) 评论(0)  编辑  收藏 所属分类: Java报表—技术知识

只有注册用户登录后才能发表评论。


网站导航: