123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975 |
- // Rexpert context root url & etc
- var targetProtocal=window.location.href.split("://")[0]; // SSL 일경우를 대비
- var rex_gsRexServiceRootURL = targetProtocal+"://" + location.host + "/himed/rexpert/";
- var rex_gsPreViewURL = rex_gsRexServiceRootURL + "rexpreview.jsp";
- var rex_gsRptServiceURL = rex_gsRexServiceRootURL + "rexservice.jsp";
- //var rex_gsReportURL = rex_gsRexServiceRootURL + "rebfiles/";
- var rex_gsReportURL = "http://" + location.host;
- // Export Service URL
- var rex_gsRptExportServiceURL = "http://" + location.host + "/himed/rexpert/" + "exportservice.jsp";
- // Export URL
- var rex_gsRptExportURL = "http://" + location.host + "/himed/rexpert/" + "export.jsp";
- // default DBconnection
- var rex_gsUserService = "hisdb";
- // viewer Version
- var rex_viewer_version = "1,0,0,17";
- var rex_viewer_install = "EACH"; // EACH, ONCE, NONE
- // CSV
- var rex_gsCsvSeparatorColumn = "|*|";
- var rex_gsCsvSeparatorRow = "^#^";
- var rex_gsCsvEncoding = "utf-8";
- // XML
- var rex_gsXPath = "gubun/rpt1/rexdataset/rexrow";
- // 2013.02.13 장재현 - Rexpert Size 조절 옵션화로 인해 ZUM006.JS 파일에서 선언함.
- // Rexpert Web Viewer Windows Size
- // var rex_gsPreViewFeatures = "center=yes,scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=855,height=800";
- var rex_gsPreViewFeaturesModal = "center:yes;resizable:no;scroll:no;status:no;dialogWidth:855px;dialogHeight:800px";
- // Language information
- var rex_gsViewerLanguage = "ko";
- // RexServer 2.5 compatible
- var rex_gsServerVersion = "3.0" // 2.5, 3.0
- var rex_gsRptServiceURL_RexServer25 = "http://" + location.host + "/report/" + "RexService.jsp";
- var rex_gsCsvSeparatorColumn_RexServer25 = "|*|";
- var rex_gsCsvSeparatorRow_RexServer25 = "^#^";
- var rex_gsCsvEncoding_RexServer25 = "EUC-KR";
- var rex_gsXPath_RexServer25 = "root/main/rpt1/rexdataset/rexrow";
- var rex_Agent = function () {
- var a = navigator.userAgent;
- function is(s,t) {
- return ((s||"").indexOf(t)>-1);
- }
- this.isWin = is(a,"Windows");
- this.isMac = is(a,"Macintosh");
- this.isUnix = !(this.isWin || this.isMac);
- this.isVista = is(a.toLowerCase(), "nt 6");
- this.isWinXp = is(a.toLowerCase(), "nt 5.1");
- this.isW2k = is(a.toLowerCase(), "nt 5.0");
- this.isW98 = is(a.toLowerCase(), "windows 98");
- this.isOP = is(a.toLowerCase(),"opera");
- this.isIE = is(a.toLowerCase(),"msie");
- this.isFF = is(a.toLowerCase(),"firefox");
- this.isCR = is(a.toLowerCase(),"chrome");
- this.isSF = is(a.toLowerCase(),"safari");
- if (this.isIE) {
- var v = parseFloat(a.match(/MSIE ([0-9\.]+)/)[1]);
- if (isNaN(v)) this.isIE0 = true;
- if (6 <= v && v < 7) {
- this.isIE6 = true;
- return;
- } else if (7 <= v && v < 8) {
- this.isIE7 = true;
- return;
- } else if (5.5 <= v && v < 6) {
- this.isIE55 = true;
- return;
- } else if (v < 5.5) {
- this.isIE5 = true;
- this.isIE = false;
- return;
- } else if (8 <= v) {
- this.isIE8 = true;
- return;
- }
- }
- }
- function rex_writeRexCtl(sID) {
- var sWidth = "100%";
- var sHeight = "100%";
- if (arguments.length > 1) sWidth = arguments[1];
- if (arguments.length > 2) sHeight = arguments[2];
- document.write(rex_getRexCtl(sID, sWidth, sHeight));
- }
- function rex_getRexCtl() {
- var oAgent = new rex_Agent();
- var sCtl = "";
- var sID = "RexCtl";
- var sWidth = "100%";
- var sHeight = "100%";
- if (arguments.length > 0) sID = arguments[0];
- if (arguments.length > 1) sWidth = arguments[1];
- if (arguments.length > 2) sHeight = arguments[2];
- if (oAgent.isWin) {
- if (oAgent.isIE) {
- //var sCodeBase = "CODEBASE='" + rex_gsRexServiceRootURL + "/cab/Rexpert30Viewer.cab#version=" + rex_viewer_version + "'";
- if (rex_viewer_install.toUpperCase() == "NONE") sCodeBase = "";
- sCtl += "<object id='" + sID + "' classid='CLSID:FC035099-833E-4AB1-BF48-37D08F5E553C' " + " width='" + sWidth + "' height='" + sHeight + "'>";
- sCtl += "</object>";
- } else {
- sCtl += "<object id='" + sID + "' type='application/rexpert3.0.plugin,version=1.0.0.1' " +
- " codebase='" + rex_gsRexServiceRootURL + "/cab/rexpert30viewer.exe' " +
- " pluginspage='" + rex_gsRexServiceRootURL + "/cab/download/setup.html'" + " width='" + sWidth + "' height='" + sHeight + "'/>";
- }
- } else {
- sCtl += "<iframe id='rex_ifrmRexPreview' src='" + rex_gsRexServiceRootURL + "/cab/download/export.html' width='" + sWidth + "' height='" + sHeight + "'></iframe>";
- }
- return sCtl;
- }
- //********************************************************
- //LocationHost() class declaration
- //********************************************************
- function rex_fnLocationHost()
- {
- var str = "" + document.location;
- var header = "http://";
- var header_length = header.length;
- var pos = str.indexOf( "/" , header_length );
- var str_server = str.substring( 0, pos );
- return str_server;
- }
- //********************************************************
- //param class declaration
- //********************************************************
- var rex_goParamSet = {};
- var rex_iframeindex = 0;
- var rex_iframeid = new Array();
- var rex_iframedata = new Array();
- function GetfnParamSet() {
- if (arguments.length > 0) {
- rex_goParamSet[arguments[0]] = new rex_fnParamSet(arguments[0]);
- rex_goParamSet[arguments[0]].datatype = "CSV";
- return rex_goParamSet[arguments[0]];
- }
- else {
- rex_goParamSet["0"] = new rex_fnParamSet("0");
- return rex_goParamSet["0"];
- }
- }
- function rex_fnParamSet(id) {
- this.id = id;
- this.type; //http, file, memo, ado(not used)
- this.opentype;
- this.rptname;
- this.exportrptname = null;
- this.exportfiletype = "pdf";
- this.datatype;
- this.title; // added by kimhd.
- this.rptnames; // added by kimhd. it stores array of rptname;
- this.callback; // added by kimhd. it invoked after printing.
-
- this.rebfiles = {};
- this.subreports = {};
- this.params = {};
- this.httpparams = {};
- this.datasets = {};
- this.printoption;
- this.event = {};
- rex_fnParamSet.prototype.reb = function(id) {
- if (this.rebfiles[id] == undefined) {
- this.rebfiles[id] = new rex_RebFile(id);
- }
- return this.rebfiles[id];
- }
-
- rex_fnParamSet.prototype.param = function(id) {
- if (this.params[id] == undefined) {
- this.params[id] = {};
- }
- return this.params[id];
- }
-
- rex_fnParamSet.prototype.httpparam = function(id) {
- if (this.httpparams[id] == undefined) {
- this.httpparams[id] = {};
- }
- return this.httpparams[id];
- }
-
- rex_fnParamSet.prototype.sub = function(id) {
- if (this.subreports[id] == undefined) {
- this.subreports[id] = new rex_RebSubReport(id);
- }
-
- return this.subreports[id];
- }
- rex_fnParamSet.prototype.dataset = function(id) {
- if (this.datasets[id] == undefined) {
- this.datasets[id] = {};
- }
-
- return this.datasets[id];
- }
- rex_fnParamSet.prototype.toString = function() {
- var sb = "";
- var con = new rex_RebConnction();
- var oParam = {};
- var rebfile = new rex_RebFile();
- sb += "<?xml version='1.0' encoding='utf-8'?>";
- sb += "<oof version ='3.0'>";
- //sb += "<document title='A' enable-thread='0'>";
- sb += "<document enable-thread='1'>";
- //sb += "<document>";
-
- if (this.type == undefined) this.type = "http";
- sb += "<file-list>";
- if(this.rptname != undefined)
- {
- sb += rebfile.toStringFile(this.rptname, "", "") + "";
- this.exportrptname = this.rptname.substr(this.rptname.lastIndexOf("/") + 1);
- }
- var sConnMain = "";
- var sConnSub = "";
- var sConn = "";
- for(var nkey in this.rebfiles)
- {
- if (this.rebfiles[nkey].connectname != undefined) {
- oParam["type"] = this.rebfiles[nkey].type;
- oParam["namespace"] = this.rebfiles[nkey].namespace;
- oParam["path"] = this.rebfiles[nkey].path;
- oParam["data"] = this.rebfiles[nkey].data;
- oParam["connectname"] = this.rebfiles[nkey].connectname;
- oParam["datatype"] = this.rebfiles[nkey].datatype;
- oParam["xpath"] = this.rebfiles[nkey].xpath;
- oParam["encoding"] = this.rebfiles[nkey].encoding;
- con = new rex_RebConnction();
- sConn += con.toString(oParam, this.rebfiles[nkey].httpparams, this.rebfiles[nkey].datasets);
- }
- for(var key in this.rebfiles[nkey].subreports)
- {
- if(key != undefined)
- {
- if(this.rebfiles[nkey].sub(key).namespace == undefined )
- {
- oParam["namespace"] = key;
- } else {
- oParam["namespace"] = this.rebfiles[nkey].sub(key).namespace;
- }
- oParam["type"] = this.rebfiles[nkey].sub(key).type;
- oParam["path"] = this.rebfiles[nkey].sub(key).path;
- oParam["data"] = this.rebfiles[nkey].sub(key).data;
- oParam["connectname"] = this.rebfiles[nkey].sub(key).connectname;
- oParam["datatype"] = this.rebfiles[nkey].sub(key).datatype;
- oParam["xpath"] = this.rebfiles[nkey].sub(key).xpath;
- oParam["encoding"] = this.rebfiles[nkey].sub(key).encoding;
- con = new rex_RebConnction();
- sConn += con.toString(oParam, this.rebfiles[nkey].sub(key).httpparams, this.rebfiles[nkey].sub(key).datasets);
- }
- }
- if (sConn != "") {
- sConn = "<connection-list>" + sConn + "</connection-list>";
- }
- //alert(this.rebfiles[nkey].subreports["ADO2"]);
- if(this.rebfiles[nkey].rptname != undefined)
- {
- rebfile = new rex_RebFile();
- sb += rebfile.toStringFile(this.rebfiles[nkey].rptname, rebfile.toStringField(this.rebfiles[nkey].params), sConn) + "";
-
- if (this.exportrptname == null) {
- this.exportrptname = this.rebfiles[nkey].rptname.substr(this.rebfiles[nkey].rptname.lastIndexOf("/") + 1);
- }
- }
- } // end for
- sb += "</file-list>";
- sConnMain += "<connection-list>";
- for(var nkey in this.subreports)
- {
- if(this.subreports[nkey].namespace == undefined )
- {
- oParam["namespace"] = nkey;
- } else {
- oParam["namespace"] = this.subreports[nkey].namespace;
- }
- oParam["type"] = this.subreports[nkey].type;
- oParam["path"] = this.subreports[nkey].path;
- oParam["data"] = this.subreports[nkey].data;
- oParam["connectname"] = this.subreports[nkey].connectname;
- oParam["datatype"] = this.subreports[nkey].datatype;
- oParam["xpath"] = this.subreports[nkey].xpath;
- oParam["encoding"] = this.subreports[nkey].encoding;
- con = new rex_RebConnction();
- sConnSub += con.toString(oParam, this.subreports[nkey].httpparams, this.subreports[nkey].datasets);
- }
- if (sConnSub == "") {
- oParam["type"] = this.type; // http, file, memo
- oParam["namespace"] = this.namespace;
- oParam["path"] = this.path;
- oParam["data"] = this.data;
- oParam["connectname"] = this.connectname;
- oParam["datatype"] = this.datatype;
- oParam["xpath"] = this.xpath;
- oParam["encoding"] = this.encoding;
-
- sConnMain += con.toString(oParam, this.httpparams, this.datasets);
- } else {
- sConnMain += sConnSub;
- }
- sConnMain += "</connection-list>";
- if (sConn == "") {
- sb += sConnMain;
- }
- sb += rebfile.toStringField(this.params);
-
- sb += "</document>";
- sb += "</oof>";
-
- return sb;
- }
- } // end of rex_fnParamSet
- function rex_RebFile() {
- this.id = arguments[0];
- this.subreports = {};
- this.params = {};
- this.httpparams = {};
- rex_RebFile.prototype.sub = function(id) {
- if (this.subreports[id] == undefined) {
- this.subreports[id] = new rex_RebSubReport(id);
- }
- return this.subreports[id];
- }
- rex_RebFile.prototype.param = function(id) {
- if (this.params[id] == undefined) {
- this.params[id] = {};
- }
-
- return this.params[id];
- }
- rex_RebFile.prototype.httpparam = function(id) {
- if (this.httpparams[id] == undefined) {
- this.httpparams[id] = {};
- }
- return this.httpparams[id];
- }
- rex_RebFile.prototype.toStringFile = function(rptname, param, connect) {
- var sb = "";
- if (rptname.length > 7) {
- if (rptname.substring( 0, 7 ) != "http://" && rptname.substring( 0, 8 ) != "https://") {
- rptname = rex_gsReportURL + rptname;
- }
- } else {
- rptname = rex_gsReportURL + rptname;
- }
- //sb += "<file type='reb' path='" + rptname + ".reb'>";
- sb += "<file type='reb' path='" + rptname+"'>"; // modified by kimhd
- sb += param;
- sb += connect;
- sb += "</file>";
- return sb;
- }
- rex_RebFile.prototype.toStringField = function(param) {
- var sb = "";
- sb += "<field-list>";
- for ( var key in param) {
- sb += "<field name='" + key + "'><![CDATA[" + param[key].value + "]]></field>";
- }
- sb += "</field-list>";
- return sb;
- }
- } // end of rex_RebFile
- function rex_RebSubReport() {
- this.id = arguments[0];
- this.params = {};
- this.httpparams = {};
- this.datasets = {}
- rex_RebSubReport.prototype.param = function(id) {
- if (this.params[id] == undefined) {
- this.params[id] = {};
- }
- return this.params[id];
- }
- rex_RebSubReport.prototype.httpparam = function(id) {
- if (this.httpparams[id] == undefined) {
- this.httpparams[id] = {};
- }
- return this.httpparams[id];
- }
- rex_RebSubReport.prototype.dataset = function(id) {
- if (this.datasets[id] == undefined) {
- this.datasets[id] = {};
- }
- return this.datasets[id];
- }
- } // end of rex_RebSubReport
- function rex_RebConnction() {
- rex_RebConnction.prototype.toString = function(oParam, oHttpParams, oDataSets) {
- var sb = "";
- var type = oParam["type"];
- var namespace = oParam["namespace"];
- var path = oParam["path"];
- var isExistPath = false;
- var data = oParam["data"];
- var connectname = oParam["connectname"];
- var datatype = oParam["datatype"];
- var encoding = oParam["encoding"];
- var xpath = oParam["xpath"];
- if (type == undefined) type = "http";
- if (namespace == undefined) namespace = "*";
- if (path == undefined) {
- isExistPath = false;
-
- if (rex_gsServerVersion == "2.5") {
- path = rex_gsRptServiceURL_RexServer25;
- } else {
- path = rex_gsRptServiceURL;
- }
- } else {
- isExistPath = true;
- }
- if (data == undefined) data = "";
-
- if (connectname == undefined) {
- if (rex_gsServerVersion == "2.5") {
- connectname = "";
- } else {
- connectname = rex_gsUserService;
- }
- }
- if (datatype == undefined) datatype = "CSV";
- if (encoding == undefined) {
-
- if (rex_gsServerVersion == "2.5") {
- encoding = rex_gsCsvEncoding_RexServer25;
- } else {
- encoding = rex_gsCsvEncoding;
- }
- }
- if (xpath == undefined) {
- if (rex_gsServerVersion == "2.5") {
- xpath = rex_gsXPath_RexServer25;
- } else {
- if (type == "http") {
- if (!isExistPath) xpath = rex_gsXPath;
- } else {
- xpath = "{%dataset.xml.root%}";
- }
- }
- }
- sb += "<connection type='" + type + "' namespace='" + namespace + "'>";
- var sHttpParams = "";
- if(oHttpParams != undefined )
- {
- for(var key in oHttpParams)
- {
- if (typeof(oHttpParams[key].value) == "object") {
- for(var i = 0; i < oHttpParams[key].value.length; i++) {
- sHttpParams += "<http-param name='" + key + "'><![CDATA[" + oHttpParams[key].value[i] + "]]></http-param>";
- }
- } else {
- sHttpParams += "<http-param name='" + key + "'><![CDATA[" + oHttpParams[key].value + "]]></http-param>";
- //sHttpParams += "<http-param name='" + key + "'>" + oHttpParams[key].value + "</http-param>";
- }
- }
- }
- if (type == "http") {
- if (sHttpParams != "") {
- sHttpParams = "<http-param-list>" + sHttpParams + "</http-param-list>";
- } else if (isExistPath == false) {
- if (rex_gsServerVersion == "2.5") {
- sHttpParams += "<http-param-list>";
- sHttpParams += "<http-param name='designtype'>run</http-param>";
- sHttpParams += "<http-param name='datatype'>" + datatype.toUpperCase() + "</http-param>";
- sHttpParams += "<http-param name='sql'>{%auto%}</http-param>";
- sHttpParams += "<http-param name='split'></http-param>";
- sHttpParams += "<http-param name='userservice'>" + connectname + "</http-param>";
- sHttpParams += "<http-param name='image'></http-param>";
- sHttpParams += "<http-param name='rex_param_sql'></http-param>";
- sHttpParams += "</http-param-list>";
- } else {
- sHttpParams += "<http-param-list>";
- sHttpParams += "<http-param name='Q1SQL'>{%auto%}</http-param>";
- sHttpParams += "<http-param name='OE'>None</http-param>";
- sHttpParams += "<http-param name='CN'>" + connectname + "</http-param>";
- sHttpParams += "<http-param name='ID'>SD" + datatype.toUpperCase() + "</http-param>";
- sHttpParams += "<http-param name='PE'>FALSE</http-param>";
- sHttpParams += "<http-param name='QC'>1</http-param>";
- sHttpParams += "<http-param name='OT'>DataOnly</http-param>";
- sHttpParams += "<http-param name='Q1Type'>SQL</http-param>";
- sHttpParams += "</http-param-list>";
- }
- }
- sb += "<config-param-list>";
- sb += "<config-param name='path'>" + path + "</config-param>";
- sb += "</config-param-list>";
- sb += sHttpParams;
- } else if (type == "file") {
- sb += "<config-param-list>";
- sb += "<config-param name='path'>" + path + "</config-param>";
- sb += "</config-param-list>";
- if (sHttpParams != "") {
- sb += sHttpParams;
- }
- } else if (type == "memo") {
- sb += "<config-param-list>";
- if (datatype.toUpperCase() == "CSV") {
- sb += "<config-param name='data'><![CDATA[" + data + "]]></config-param>";
- } else {
- sb += "<config-param name='data'>" + data + "</config-param>";
- }
- sb += "</config-param-list>";
- }
- if (datatype.toUpperCase() == "CSV") {
- if (rex_gsServerVersion == "2.5") {
- sb += "<content content-type='csv'>";
-
- if (type == "memo") {
- sb += "<content-param name='col-delim'>" + rex_gsCsvSeparatorColumn + "</content-param>";
- sb += "<content-param name='row-delim'>" + rex_gsCsvSeparatorRow + "</content-param>";
- encoding = "utf16le";
- } else {
- sb += "<content-param name='col-delim'>" + rex_gsCsvSeparatorColumn_RexServer25 + "</content-param>";
- sb += "<content-param name='row-delim'>" + rex_gsCsvSeparatorRow_RexServer25 + "</content-param>";
- }
- sb += "<content-param name='encoding'>" + encoding + "</content-param>";
- sb += "</content>";
- } else {
- sb += "<content content-type='csv'>";
- sb += "<content-param name='col-delim'>" + rex_gsCsvSeparatorColumn + "</content-param>";
- sb += "<content-param name='row-delim'>" + rex_gsCsvSeparatorRow + "</content-param>";
- if (type == "memo") encoding = "utf16le";
- sb += "<content-param name='encoding'>" + encoding + "</content-param>";
- sb += "</content>";
- }
- } else {
- var sDataSets = "";
- if(oDataSets != undefined )
- {
- for(var key in oDataSets)
- {
- sDataSets += "<content content-type='xml' namespace='" + key + "'>";
- sDataSets += "<content-param name='root'>" + oDataSets[key].xpath + "</content-param>";
- sDataSets += "<content-param name='preservedwhitespace'>1</content-param>";
- sDataSets += "<content-param name='bindmode'>name</content-param>";
- sDataSets += "</content>";
- }
- }
- if (sDataSets == "") {
- sDataSets += "<content content-type='xml'>";
- sDataSets += "<content-param name='root'>" + xpath + "</content-param>";
- sDataSets += "<content-param name='preservedwhitespace'>1</content-param>";
- sDataSets += "<content-param name='bindmode'>name</content-param>";
- sDataSets += "</content>";
- }
- sb += sDataSets;
- }
- sb += "</connection>";
- return sb;
- }
- } // end of rex_RebConnction
- rex_fnParamSet.prototype.open = function(iveiwerObj) {
- this.opentype = "open";
- //var oAgent = new rex_Agent();
- if (iveiwerObj != null)
- {
- iveiwerObj.window.javascript.loadReport(rex_gsPreViewURL + "?id=" + this.id);
- }
- else
- {
- window.open(rex_gsPreViewURL + "?id=" + this.id, "", rex_gsPreViewFeatures);
- }
- //if (oAgent.isWin) {
-
- //} else {
- // Mac, Unix(Linux)
- // alert("Mac or Linux : PDF");
- //}
- }
- rex_fnParamSet.prototype.iframe = function(oIframe) {
- this.opentype = "iframe";
- var oAgent = new rex_Agent();
- if (oAgent.isIE) {
- if (typeof(oIframe) == "object") {
- oIframe.location.href = rex_gsPreViewURL + "?id=" + this.id;
- } else {
- document.getElementById(oIframe).src = rex_gsPreViewURL + "?id=" + this.id;
- }
- } else {
- if (typeof(oIframe) == "object") {
- document.getElementById(oIframe.name).contentWindow.location.href = rex_gsPreViewURL + "?id=" + this.id;
- } else {
- document.getElementById(oIframe).contentWindow.location.href = rex_gsPreViewURL + "?id=" + this.id;
- }
- }
- }
- rex_fnParamSet.prototype.embed = function(sRexCtl) {
- this.opentype = "embed";
- var oAgent = new rex_Agent();
- var oOOF;
- var oRexCtl;
- oRexCtl = document.getElementById(sRexCtl);
- oOOF = rex_goParamSet[this.id];
- if (oAgent.isWin) {
- var printoption = oOOF.printoption;
- var exportoption = oOOF.exportoption;
- var toolbarbuttonoption = oOOF.toolbarbuttonoption;
- if(printoption != null) {
- rex_fnPrintSetting(oRexCtl,printoption);
- }
- if(exportoption != null) {
- rex_fnExportVisible(oRexCtl, exportoption);
- }
- if(toolbarbuttonoption != null) {
- rex_fnToolBarButtonEnableTrue(oRexCtl,toolbarbuttonoption);
- }
- try {
- var sVer = oRexCtl.GetVersion();
- } catch(ex) {
- // activex not install !!
- return;
- }
- if (oOOF.event.init != undefined) {
- oOOF.event.init(oRexCtl, "init", null);
- }
- oRexCtl.CloseAll();
- oRexCtl.OpenOOF(oOOF.toString());
- } else {
- // Mac, Linux, Others
- document.getElementById("rex_ifrmRexPreview").contentWindow.location.href = rex_gsPreViewURL + "?id=" + this.id;
- }
- }
- rex_fnParamSet.prototype.iframepush = function(id,param) {
- var iframparam;
- rex_iframeid.push(id);
- if(rex_iframeid.length>0 )
- {
-
- iframparam = rex_goParamSet[rex_iframeindex];
- //alert(" rex_goParamSet["+rex_iframeindex+"]"+ rex_goParamSet[rex_iframeindex]);
- rex_fnParamSet.prototype.iframe(rex_iframeid[rex_iframeindex],rex_goParamSet[rex_iframeindex]);
-
- }
- rex_iframeindex++;
- }
- rex_fnParamSet.prototype.iframeall = function() {
- //alert("aaaa");
- var param1 = rex_goParamSet["1"];
- //alert("1111" + param1);
- rex_fnParamSet.prototype.iframe("ifrmRexview",param1);
- }
- rex_fnParamSet.prototype.popupmodal = function() {
- //alert(this);
- //goOOF = this;
- window.showModalDialog(rex_gsPreViewURL,window,"center:yes;resizable:no;scroll:no;status:no;dialogWidth:825px;dialogHeight:600px");
- }
- rex_fnParamSet.prototype.print = function() {
- this.opentype = "print";
- this.print = {};
- this.print.dialog = arguments[0];
- this.print.startpage = arguments[1];
- this.print.endpage = arguments[2];
- this.print.copycount = arguments[3];
- this.print.Option = arguments[4];
- var oAgent = new rex_Agent();
- if (oAgent.isIE) {
- if (document.getElementById("rex_ifrmRexPreview") == null) {
- var sHTML = "<iframe id='rex_ifrmRexPreview' src='" + rex_gsPreViewURL + "?id=" + this.id + "' width='5' height='5'></iframe>";
- //document.body.innerHTML += sHTML;
- document.body.insertAdjacentHTML("beforeEnd", sHTML);
- } else {
- document.getElementById("rex_ifrmRexPreview").src = rex_gsPreViewURL + "?id=" + this.id;
- }
- } else {
- if (document.getElementById("rex_ifrmRexPreview") == null) {
- var sHTML = "<iframe id='rex_ifrmRexPreview' src='" + rex_gsPreViewURL + "?id=" + this.id + "' width='0' height='0'></iframe>";
- //document.body.insertAdjacentHTML("beforeEnd", sHTML);
- document.body.innerHTML += sHTML;
- //document.body.appendChild( document.createTextNode(sHTML) );
- //document.getElementById("rex_ifrmRexPreview").contentWindow.location.href = rex_gsPreViewURL + "?id=" + this.id;
- } else {
- document.getElementById("rex_ifrmRexPreview").contentWindow.location.href = rex_gsPreViewURL + "?id=" + this.id;
- }
- }
- }
- rex_fnParamSet.prototype.save = function() {
- this.opentype = "save";
- this.save = {};
- this.save.dialog = arguments[0];
- this.save.filetype = arguments[1];
- this.save.fileName = arguments[2];
- this.save.startpage = arguments[3];
- this.save.endpage = arguments[4];
- this.save.Option = arguments[5];
- var oAgent = new rex_Agent();
- if (oAgent.isIE) {
- if (document.getElementById("rex_ifrmRexPreview") == null) {
- var sHTML = "<iframe id='rex_ifrmRexPreview' src='" + rex_gsPreViewURL + "?id=" + this.id + "' width='0' height='0'></iframe>";
- document.body.insertAdjacentHTML("beforeEnd", sHTML);
- } else {
- document.getElementById("rex_ifrmRexPreview").src = rex_gsPreViewURL + "?id=" + this.id;
- }
- } else {
- window.open(rex_gsPreViewURL + "?id=" + this.id, "", "center=yes,scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no, left=1000, top=1000, width=10,height=10");
- }
- }
- rex_fnParamSet.prototype.exportserver = function() {
- this.opentype = "export";
- this.exportserver = {};
- this.exportserver.filename = arguments[0];
- this.exportserver.filetype = arguments[1];
- var oAgent = new rex_Agent();
- if (oAgent.isIE) {
- if (document.getElementById("rex_ifrmRexPreview") == null) {
- var sHTML = "<iframe id='rex_ifrmRexPreview' src='" + rex_gsPreViewURL + "?id=" + this.id + "' width='0' height='0'></iframe>";
- document.body.insertAdjacentHTML("beforeEnd", sHTML);
- } else {
- document.getElementById("rex_ifrmRexPreview").src = rex_gsPreViewURL + "?id=" + this.id;
- }
- } else {
- window.open(rex_gsPreViewURL + "?id=" + this.id, "", "center=yes,scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no, left=1000, top=1000, width=10,height=10");
- }
- }
- //********************************************************
- //fnPrintSetting class declaration
- //********************************************************
- function rex_fnPrintSetting(oRexCtl,printoption)
- {
- if (printoption.indexOf("paperorientation=") >= 0) {
- // change paper orientation, so we set to ignore report setting.
- oRexCtl.SetCSS("print.papersetting=1");
- }
- if (printoption.indexOf("frompage=") >= 0 || printoption.indexOf("topage") >= 0) {
- // set to print range.
- oRexCtl.SetCSS("print.printrange=1");
- }
-
- var arrprint = [];
- var strprint = printoption.split(";");
- for(var i =0; i< strprint.length; i++)
- {
- arrprint[i] = strprint[i];
- }
- for(var i =0 ; i < arrprint.length; i++)
- {
- oRexCtl.SetCSS("print."+arrprint[i]);
- }
- oRexCtl.UpdateCSS();
- }
- //********************************************************
- //fnExportVisible class declaration
- //********************************************************
- function rex_fnExportVisible(oRexCtl, exportoption)
- {
- var sb = "";
- var strexport = exportoption.split(";");
- var arrexport =[] ;
- for(var i =0; i< strexport.length; i++)
- {
- arrexport[i] = strexport[i];
- }
- for(var i =0 ; i < arrexport.length; i++)
- {
- var lastexport = arrexport[i].split("=");
- //sb += "RexCtl.SetCSS(\"export.appearance."+lastexport[0]+".visible="+lastexport[1]+"\");");
- oRexCtl.SetCSS("export.appearance."+lastexport[0]+".visible="+lastexport[1]);
- }
- //sb += "RexCtl.UpdateCSS();");
- oRexCtl.UpdateCSS();
- //return sb;
- }
- function rex_fnToolBarButtonVisible(oRexCtl,toolbarbuttonoption) {
- if (toolbarbuttonoption.indexOf("open=1") < 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.open.visible=0");
- }
- if (toolbarbuttonoption.indexOf("save=1") < 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.export.visible=0");
- }
- if (toolbarbuttonoption.indexOf("print=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.print.visible=0");
- }
- if (toolbarbuttonoption.indexOf("refresh=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.refresh.visible=0");
- }
- if (toolbarbuttonoption.indexOf("zoom=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.zoom.visible=0");
- }
- if (toolbarbuttonoption.indexOf("excel=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.exportxls.visible=0");
- }
- if (toolbarbuttonoption.indexOf("pdf=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.exportpdf.visible=0");
- }
- if (toolbarbuttonoption.indexOf("hwp=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.exporthwp.visible=0");
- }
- if (toolbarbuttonoption.indexOf("moveprev=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.moveprev.visible=0");
- }
- if (toolbarbuttonoption.indexOf("movenext=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.movenext.visible=0");
- }
- if (toolbarbuttonoption.indexOf("page=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.pagenumber.visible=0");
- oRexCtl.SetCSS("appearance.toolbar.button.pagecount.visible=0");
- }
- if (toolbarbuttonoption.indexOf("movefirst=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.movefirst.visible=0");
- }
- if (toolbarbuttonoption.indexOf("movelast=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.movelast.visible=0");
- }
- if (toolbarbuttonoption.indexOf("about=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.button.about.visible=0");
- }
- if (toolbarbuttonoption.indexOf("toolbar=0") >= 0) {
- oRexCtl.SetCSS("appearance.toolbar.visible=0");
- }
- if (toolbarbuttonoption.indexOf("statusbar=0") >= 0) {
- oRexCtl.SetCSS("appearance.statusbar.visible=0");
- }
- if (toolbarbuttonoption.indexOf("tab=1") < 0) {
- oRexCtl.SetCSS("appearance.tabheader.visible=0");
- }
- oRexCtl.UpdateCSS();
- }
-
- function rex_fnToolBarButtonEnableTrue(oRexCtl,toolbarbuttonoption)
- {
- var sb = "";
- oRexCtl.SetCSS("appearance.toolbar.button."+toolbarbuttonoption);
- oRexCtl.UpdateCSS();
- }
|