Brio常用脚本
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
g_Obj.AddNewLimit("查询-UNIT","结果-UNIT","DropDown1",true,1,"单位" //"查询-UNIT","结果-UNIT","ListBox_Unit",true,1,"单位" ); //********************用户初始变量(END)************************** g_Obj.InitMenu(); //g_Obj.LimitInit(); g_Obj.CycleSetting(g_CycleType); g_Obj.ConditionProcess(); g_Obj.IsAutoSizeWidth(g_IsAutoSizeWidth); //******************************************************************* //系统公用函数 function GlobalFunctions(){ this.strMainEISName = g_MainEisName; //用户主界面的名称 this.InitMenu = GF_InitMenu; //初始化菜单和工具条 (OK) this.WriteLog = GF_WriteLog //写数据库操作日志 (OK) this.ExistSection = GF_ExistSection; //判断是否有该区域或控件 (OK) this.CycleSetting = GF_CycleSetting; //设置当前的周期 (OK) this.CycleGetting = GF_CycleGetting; //得到当前的周期 (OK) this.AddArrayItem = GF_AddArrayItem; //向主查询名中添加项 (OK) this.AddLimitValue = GF_AddLimitValue; //向主查询或主结果集中添加限制 值 (OK)
/* 函数名称:GF_ExistSection 函数功能:判断控件是否存在 参 数:strName :控件名称 eisName :EIS 名称 返回值 : true/false */ function GF_ExistSection(strName,eisName){ var returnResult = false; for(var i=1;i<=ActiveDocument.Sections[eisName].Shapes.Count;i++){ if(ActiveDocument.Sections[eisName].Shapes.Item(i).Name == strName){ returnResult = true; break; } } return (returnResult); }
/* 函数名称:GF_WriteLog() 函数功能:向数据库写操作日志 参 数:document :文档名称 opertype :操作类形 operobject :操作对象 note :操作备注 返回值 :无 */ function GF_WriteLog(document,opertype,operobject,note){ var operator = g_Operator; var use_app = ; var SQL = "insert INTO BRIO_LOG VALUES("+ "'"+operator+"',"+ "'"+document+"',"+ "'"+use_app+"',"+ "'"+opertype+"',"+ "'"+operobject+"',"+ "'"+note+"',"+ "sysdate"+ ")"; //Alert(SQL); try{ Application.SendSQL(g_Oce,g_OceUser,g_OcePass,SQL); } catch(e){ Alert("写数据库日志失败!","提示"); Alert(e,"错误原因"); return; }
if(.substr(0,9) != "BrioQuery") g_Operator = ActiveDocument.ODSUsername.toLowerCase(); else g_Operator = "sysop"; //用户登录名称
g_CycleStart = ""; //开始周期 g_CycleEnd = ""; //结束周期 g_QueryCycle = ""; //周期范围 g_OperatorName = ""; //用户名称 g_OperatorTel = ""; //用户联系电话 g_ExportPath = "" //用户导出路径 g_Oce = ""; //OCE 名称 g_OceUser = ""; //OCE 用户 g_OcePass = ""; //OCE 密码 g_ProspectusServer = ""; //报表样张服务器地址 g_AllCode = "全部"; //全部所使用的中文名称 g_ExlObjExist = false; //Excel 句柄是否存在 g_ConditionArry = new Array(); g_MainQueryName = new Array(); //存放主数据查询名称 g_MainResultName= new Array(); //存放主数据结果名称
Alert("<"+g_Operator+">用户系统资料错误,请与系统管理员联系!","提示");
return;
}
try{
g_OperatorName = ActiveDocument.Sections["表-USERINFO"].GetCell(1,3);
g_OperatorTel = ActiveDocument.Sections["表-USERINFO"].GetCell(2,3);
下面给大家发一段代码放到onstartup中去执行这样可以对做一个新的文档能简化一些工作当然脚本还不是很完善大家毕竟都有自己的需求放上来可以大家一同修改完善不足之处希望大家指出初始变量gcycletypemonth
在 BRIO 的开发中,由于其没有继承的特性,很多东西都要不同程度的重复工作, 这给大家都造成很多麻烦。下面给大家发一段代码,放到 ONSTARTUP 中去执行, 这样可以对做一个新的文档能简化一些工作,当然脚本还不是很完善,大家毕竟 都有自己的需求,放上来可以大家一同修改,完善,不足之处,希望大家指出
/********************得到用户资料*************************/
ActiveDocument.Fra bibliotekections[
查
询
-SYSINFO"].Limits["Oid"].SelectedValues.RemoveAll();
ActiveDocument.Sections["
}
/* 函数名称:GF_InitMenu() 函数功能:根据打开 BQY 的客户端出始化菜单 返回值 :无 */ function GF_InitMenu(){ ActiveDocument.Sections[g_MainEisName].Activate(); if( == "Brio.Insight"){ Toolbars["标准"].Visible = false; Toolbars["格式"].Visible = false; Toolbars["区"].Visible = false; Toolbars["导航"].Visible = false; Application.ShowMenuBar = false; ActiveDocument.ShowCatalog = false; ActiveDocument.ShowSectionTitleBar = false; } if( == "Brio.Quickview"){ Toolbars["标准"].Visible = false; Application.ShowMenuBar = false; ActiveDocument.ShowCatalog = false; ActiveDocument.ShowSectionTitleBar = false; } }
this.ProcessQuery = GF_ProcessQuery; //处理查询 (OK) this.Exit = GF_Exit; //系统退出 (OK) this.CreateLimit = GF_CreateLimit; //创建限制对象 (OK) this.CreateSort = GF_CreateSort; //创建排序对象 (OK) this.ImportData = GF_ImportData; //导入结果数据 (OK) this.ListBoxAddData = GF_ListBoxAddData; //向列表框中填写数据 (OK) this.OnSelect = GF_OnSelect; //列表框事件处理 (OK) this.AddNewLimit = GF_AddNewLimit; //添加新的控件做为限制条件 (OK) this.LimitInit = GF_LimitInit; //查询条件初始化 (OK) this.ConditionProcess = GF_ConditionProcess; //查询条件初始化 (OK) this.IsAutoSizeWidth = GF_IsAutoSizeWidth; //旋转透视表是否自适应宽度 (OK) }
//************************全局变量*********************************** g_Obj = new GlobalFunctions(); //********************用户初始变量(START)************************** g_Obj.AddArrayItem("查询-数据","结果-数据");
查
询
-SYSINFO"].Limits["Oid"].SelectedValues.Add(g_Operator);
ActiveDocument.Sections["查询-SYSINFO"].Process();
if(ActiveDocument.Sections["结果-SYSINFO"].RowCount == 0){
/********************初始变量*************************/ g_CycleType = "MONTH"; //报表类形(日报:DAY,月报:MONTH) g_MainEisName = "EIS"; //主界面 g_IsAutoSizeWidth = false; //旋转透视表是否自适应宽度
g_ExportPath = ActiveDocument.Sections["表-USERINFO"].GetCell(3,3); g_Oce = ActiveDocument.Sections["表-LOGIN"].GetCell(1,2); g_OceUser = ActiveDocument.Sections["表-LOGIN"].GetCell(2,2); g_OcePass = ActiveDocument.Sections["表-LOGIN"].GetCell(3,2); g_ProspectusServer = ActiveDocument.Sections["表-LOGIN"].GetCell(4,2); } catch(e){ Alert("<"+g_Operator+">用户系统资料错误,请与系统管理员联系!","提示"); Alert(e,"提示"); if(.substr(0,9) != "BrioQuery"){ ActiveDocument.Sections["查询-SYSINFO"].Remove(); } return; } if(.substr(0,9) != "BrioQuery"){ ActiveDocument.Sections["查询-SYSINFO"].Remove(); }
/* 函数名称:GF_ExistSection 函数功能:判断控件是否存在 参 数:strName :控件名称 eisName :EIS 名称 返回值 : true/false */ function GF_ExistSection(strName,eisName){ var returnResult = false; for(var i=1;i<=ActiveDocument.Sections[eisName].Shapes.Count;i++){ if(ActiveDocument.Sections[eisName].Shapes.Item(i).Name == strName){ returnResult = true; break; } } return (returnResult); }
/* 函数名称:GF_WriteLog() 函数功能:向数据库写操作日志 参 数:document :文档名称 opertype :操作类形 operobject :操作对象 note :操作备注 返回值 :无 */ function GF_WriteLog(document,opertype,operobject,note){ var operator = g_Operator; var use_app = ; var SQL = "insert INTO BRIO_LOG VALUES("+ "'"+operator+"',"+ "'"+document+"',"+ "'"+use_app+"',"+ "'"+opertype+"',"+ "'"+operobject+"',"+ "'"+note+"',"+ "sysdate"+ ")"; //Alert(SQL); try{ Application.SendSQL(g_Oce,g_OceUser,g_OcePass,SQL); } catch(e){ Alert("写数据库日志失败!","提示"); Alert(e,"错误原因"); return; }
if(.substr(0,9) != "BrioQuery") g_Operator = ActiveDocument.ODSUsername.toLowerCase(); else g_Operator = "sysop"; //用户登录名称
g_CycleStart = ""; //开始周期 g_CycleEnd = ""; //结束周期 g_QueryCycle = ""; //周期范围 g_OperatorName = ""; //用户名称 g_OperatorTel = ""; //用户联系电话 g_ExportPath = "" //用户导出路径 g_Oce = ""; //OCE 名称 g_OceUser = ""; //OCE 用户 g_OcePass = ""; //OCE 密码 g_ProspectusServer = ""; //报表样张服务器地址 g_AllCode = "全部"; //全部所使用的中文名称 g_ExlObjExist = false; //Excel 句柄是否存在 g_ConditionArry = new Array(); g_MainQueryName = new Array(); //存放主数据查询名称 g_MainResultName= new Array(); //存放主数据结果名称
Alert("<"+g_Operator+">用户系统资料错误,请与系统管理员联系!","提示");
return;
}
try{
g_OperatorName = ActiveDocument.Sections["表-USERINFO"].GetCell(1,3);
g_OperatorTel = ActiveDocument.Sections["表-USERINFO"].GetCell(2,3);
下面给大家发一段代码放到onstartup中去执行这样可以对做一个新的文档能简化一些工作当然脚本还不是很完善大家毕竟都有自己的需求放上来可以大家一同修改完善不足之处希望大家指出初始变量gcycletypemonth
在 BRIO 的开发中,由于其没有继承的特性,很多东西都要不同程度的重复工作, 这给大家都造成很多麻烦。下面给大家发一段代码,放到 ONSTARTUP 中去执行, 这样可以对做一个新的文档能简化一些工作,当然脚本还不是很完善,大家毕竟 都有自己的需求,放上来可以大家一同修改,完善,不足之处,希望大家指出
/********************得到用户资料*************************/
ActiveDocument.Fra bibliotekections[
查
询
-SYSINFO"].Limits["Oid"].SelectedValues.RemoveAll();
ActiveDocument.Sections["
}
/* 函数名称:GF_InitMenu() 函数功能:根据打开 BQY 的客户端出始化菜单 返回值 :无 */ function GF_InitMenu(){ ActiveDocument.Sections[g_MainEisName].Activate(); if( == "Brio.Insight"){ Toolbars["标准"].Visible = false; Toolbars["格式"].Visible = false; Toolbars["区"].Visible = false; Toolbars["导航"].Visible = false; Application.ShowMenuBar = false; ActiveDocument.ShowCatalog = false; ActiveDocument.ShowSectionTitleBar = false; } if( == "Brio.Quickview"){ Toolbars["标准"].Visible = false; Application.ShowMenuBar = false; ActiveDocument.ShowCatalog = false; ActiveDocument.ShowSectionTitleBar = false; } }
this.ProcessQuery = GF_ProcessQuery; //处理查询 (OK) this.Exit = GF_Exit; //系统退出 (OK) this.CreateLimit = GF_CreateLimit; //创建限制对象 (OK) this.CreateSort = GF_CreateSort; //创建排序对象 (OK) this.ImportData = GF_ImportData; //导入结果数据 (OK) this.ListBoxAddData = GF_ListBoxAddData; //向列表框中填写数据 (OK) this.OnSelect = GF_OnSelect; //列表框事件处理 (OK) this.AddNewLimit = GF_AddNewLimit; //添加新的控件做为限制条件 (OK) this.LimitInit = GF_LimitInit; //查询条件初始化 (OK) this.ConditionProcess = GF_ConditionProcess; //查询条件初始化 (OK) this.IsAutoSizeWidth = GF_IsAutoSizeWidth; //旋转透视表是否自适应宽度 (OK) }
//************************全局变量*********************************** g_Obj = new GlobalFunctions(); //********************用户初始变量(START)************************** g_Obj.AddArrayItem("查询-数据","结果-数据");
查
询
-SYSINFO"].Limits["Oid"].SelectedValues.Add(g_Operator);
ActiveDocument.Sections["查询-SYSINFO"].Process();
if(ActiveDocument.Sections["结果-SYSINFO"].RowCount == 0){
/********************初始变量*************************/ g_CycleType = "MONTH"; //报表类形(日报:DAY,月报:MONTH) g_MainEisName = "EIS"; //主界面 g_IsAutoSizeWidth = false; //旋转透视表是否自适应宽度
g_ExportPath = ActiveDocument.Sections["表-USERINFO"].GetCell(3,3); g_Oce = ActiveDocument.Sections["表-LOGIN"].GetCell(1,2); g_OceUser = ActiveDocument.Sections["表-LOGIN"].GetCell(2,2); g_OcePass = ActiveDocument.Sections["表-LOGIN"].GetCell(3,2); g_ProspectusServer = ActiveDocument.Sections["表-LOGIN"].GetCell(4,2); } catch(e){ Alert("<"+g_Operator+">用户系统资料错误,请与系统管理员联系!","提示"); Alert(e,"提示"); if(.substr(0,9) != "BrioQuery"){ ActiveDocument.Sections["查询-SYSINFO"].Remove(); } return; } if(.substr(0,9) != "BrioQuery"){ ActiveDocument.Sections["查询-SYSINFO"].Remove(); }