ASPxClientReportViewer=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.searchWindow=null;this.textRange=null;this.pageCount=0;this.exportWindow=null;this.pageByPage=true;this.printFrame=null;if(__aspxOpera){this.printElementName="DXOperaPrinter";this.printElement=null;this.mergeProperties(dx_XROperaPrintTrick);}
var me=this;_aspxAttachEventToElement(window,"beforeunload",function(){me.onunload();});this.PageLoad=new ASPxClientEvent();this.postBackStarted=false;},AfterInitialize:function(){this.constructor.prototype.AfterInitialize.call(this);this.RaisePageLoadEvent();if(_aspxIsExists(theForm.submit)){var submit_saved=theForm.submit;var obj=this;theForm.submit=function(){obj.postBackStarted=true;if(__aspxIE)submit_saved();else submit_saved.call(theForm);};}},mergeProperties:function(properties){for(var name in properties){this[name]=properties[name];}},onunload:function(){this.closeWindow(this.searchWindow);this.getImgElement().src=this.getUnloadPath();},getImgElement:function(){if(!_aspxIsExists(this.imgElement)){this.imgElement=document.createElement("img");this.imgElement.style.width="0px";this.imgElement.style.height="0px";this.imgElement.id="DXDummyImage";document.body.appendChild(this.imgElement);}return this.imgElement;},getUnloadPath:function(){return theForm.action+"?dxrep_unload=";},closeWindow:function(win){if(win!=null&&!win.closed){win.close();}},OnCallbackInternal:function(result,isError){if(result==""){this.SendPostBack("");return;}
var callbackType=this.getResultParam(result);if(callbackType!=null){var cacheKeyAssignmentScript=this.getResultParam(callbackType.reminder);var resultReminder=cacheKeyAssignmentScript.reminder;eval(cacheKeyAssignmentScript.param);switch(callbackType.param){case "page":this.OnPageChanged(resultReminder);break;case "print":this.OnPrint(resultReminder);break;case "search":this.OnSearch(resultReminder);break;case "saveToWindow":this.OnSaveToWindow(resultReminder);break;case "saveToDisk":this.OnSaveToDisk(resultReminder);break;case "bookmark":this.OnBookmark(resultReminder);break;}}},gotoPageInternal:function(pageIndex){this.setCurrentPageIndex(pageIndex);this.CreateLoadingPanelInsideContainer(this.getContentElement());this.execCallback("page");},getResultParam:function(result){var pos=result.indexOf("|");if(pos>-1)return{param:result.substr(0,pos),reminder:result.substr(pos+1)};return null;},execCallback:function(command,params){var f=new dx_ParamFormatter();f.params=params;var paramString=command+"="+f.getValue();if(!this.postBackStarted)this.CreateCallback(paramString);},OnCallback:function(result){this.OnCallbackInternal(result,false);},OnCallbackError:function(result){this.OnCallbackInternal(result,true);},OnPageChanged:function(result){var element=this.getContentElement();if(element!=null){element.innerHTML=result;}},OnSearch:function(result){this.OnPageChanged(result);},OnPrint:function(result){this.ensurePrintElement();this.fillPrintElement(result);if(__aspxIE&&this.printFrame.document.readyState!="complete"){var func=function(reportViewer){return function(){if(this.readyState=="complete")reportViewer.print();}}
this.printFrame.document.onreadystatechange=func(this);}else this.print();},OnSaveToWindow:function(result){if(this.exportWindow!=null&&!this.exportWindow.closed){this.exportWindow.location=result;}},OnSaveToDisk:function(result){this.setFrameSrc(result);},OnBookmark:function(result){this.OnPageChanged(result);},setFrameSrc:function(src){this.ensurePrintFrame();this.printFrame.frameElement.src=src;},print:function(){if(this.printFrame!=null){this.printFrame.focus();this.printFrame.print();}},fillPrintElement:function(content){var printDocument=this.printFrame.document;printDocument.open("text/html","replace");printDocument.write(content);printDocument.close();},ensurePrintElement:function(){this.ensurePrintFrame();},ensurePrintFrame:function(){if(this.printFrame==null){this.printFrame=window.frames[this.createFrameElement("DXPrinter").id];}},createFrameElement:function(name){var f=document.createElement("iframe");f.frameBorder="0";f.style.overflow="hidden";f.style.width="0px";f.style.height="0px";f.name=name;f.id=name;document.body.appendChild(f);return f;},showSearchWindow:function(){if(this.searchUrl==null||this.searchUrl.length==0)return;if(this.searchWindow!=null&&!this.searchWindow.closed&&this.searchWindow["repId"]!=this.name)this.closeWindow(this.searchWindow);if(this.searchWindow==null||this.searchWindow.closed){var height=105;var width=350;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var args="left="+left+",top="+top+",height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no";this.searchWindow=window.open(this.searchUrl,'_blank',args);this.searchWindow["ReportViewer"]=this;this.closeTextRange();}
this.searchWindow.focus();},findText:function(s){var f=new dx_ParamFormatter();f.parse(s);this.findTextCore(f.params);},findTextCore:function(params){var up=params["up"];var range=this.getTextRange(up);if(!range.findText(params["txt"],params["word"],params["case"],up)){this.execCallback("search",params);}},getTextRange:function(up){if(!_aspxIsExists(this.textRange)){var f=this.getContentElement();this.textRange=new dx_TextRange(f,up);}return this.textRange;},closeTextRange:function(){if(_aspxIsExists(this.textRange))this.textRange.empty();this.textRange=null;},getContentElement:function(){return _aspxGetElementById(this.name+"_Div");},setViewSize:function(width,height){var el=this.getContentElement();if(el!=null){el.style.width=_aspxGetValueWithPxUnit(width);el.style.height=_aspxGetValueWithPxUnit(height);}},onPageLoad:function(pageCount){this.textRange=null;if(_aspxIsExists(this.bookmarkHighlighter))this.bookmarkHighlighter.Reset();this.pageCount=pageCount;if(this.isInitialized)this.RaisePageLoadEvent();},getCurrentPageIndexHidenField:function(){return _aspxGetElementById(this.name+"CurrentPageIndex");},getCurrentPageIndex:function(){return parseInt(this.getCurrentPageIndexHidenField().value);},setCurrentPageIndex:function(pageIndex){return this.getCurrentPageIndexHidenField().value=pageIndex;},setHiddenFieldValue:function(fieldName,value){var hiddenField=_aspxGetElementById(this.name+fieldName);hiddenField.value=value;},RaisePageLoadEvent:function(){var args=new ASPxClientReportViewerPageLoadEventArgs(this.getCurrentPageIndex(),this.pageCount);this.PageLoad.FireEvent(this,args);},GotoBookmark:function(pageIndex,bookmarkPath){if(!this.pageByPage)return;if(pageIndex!=this.getCurrentPageIndex()){this.setCurrentPageIndex(pageIndex);this.CreateLoadingPanelInsideContainer(this.getContentElement());this.execCallback("bookmark",{path:bookmarkPath});}else{this.HighlightBookmark(bookmarkPath);}},HighlightBookmark:function(bookmarkPath){if(!_aspxIsExists(this.bookmarkHighlighter))this.bookmarkHighlighter=new dx_BookmarkHighlighter(this.getContentElement(),this.name);this.bookmarkHighlighter.Highlight(this.getCurrentPageIndex(),bookmarkPath);}});_aspxGetValueWithPxUnit=function(value){return value.toString()+'px'};function dx_ParamFormatter(){this.params=[];this.addParam=function(name,val){this.params[name]=val;}
this.getValue=function(){var val="";for(var i in this.params)val+=this.format(i,this.params[i]);return val;}
this.format=function(name,val){return name+":"+val+";";}
this.parse=function(s){var ss=s.split(";");for(var i=0;i<ss.length;i++){var sss=ss[i].split(":");if(sss.length==2)this.addParam(sss[0],sss[1]);}}}
function dx_TextRange(element,searchUp){this.isTrue=function(val){return val==true||val=="true";}
this.selText="";this.element=element;this.range=element.document.body.createTextRange();this.range.moveToElementText(element);if(this.isTrue(searchUp))this.range.moveStart("textedit",1);this.empty=function(){this.element.document.selection.empty();}
this.select=function(text){this.range.select();this.selText=text;}
this.findText=function(text,mword,mcase,up){if(text==null||text.length==0)return true;var fl=this.getFlags(mword,mcase);var val=this.isTrue(up)?this.findUp(text,fl):this.findDown(text,fl);if(val)this.select(text);return val;}
this.getFlags=function(mword,mcase){var fl=0;if(this.isTrue(mword))fl+=2;if(this.isTrue(mcase))fl+=4;return fl;}
this.findUp=function(text,fl){this.range.moveEnd("character",-this.selText.length);var val=this.range.findText(text,-1000,fl);if(!val)this.range.moveEnd("character",this.selText.length);return val;}
this.findDown=function(text,fl){this.range.moveStart("character",this.selText.length);var val=this.range.findText(text,1000,fl);if(!val)this.range.moveStart("character",-this.selText.length);return val;}}
function dx_BookmarkHighlighter(contentElement,ownerName){this.contentElement=contentElement;this.bookmarkElement=null;this.selectionTemplate=_aspxGetElementById(ownerName+"_Bookmark");this.Highlight=function(pageIndex,bookmarkPath){if(_aspxIsExists(this.bookmarkElement)){try{this.contentElement.removeChild(this.bookmarkElement)}
catch(e){}
this.bookmarkElement=null;}
bookmarkPath=pageIndex.toString()+"_"+bookmarkPath;var bookmarkElements=this.getBookmarkElements(_aspxGetElementsByTagName(this.contentElement,"A"),bookmarkPath);if(bookmarkElements.length==0)return;var bounds=this.getBookmarkBounds(bookmarkElements);this.bookmarkElement=this.addBookmarkElement(bounds);}
this.Reset=function(){this.bookmarkElement=null;}
this.getBorderWidth=function(){return parseInt(this.selectionTemplate.style.borderWidth);}
this.getBookmarkElements=function(elements,name){var bookmarkElements=new Array();for(i=0;i<elements.length;i++){if(elements[i].name==name)_aspxArrayPush(bookmarkElements,_aspxGetParentNode(elements[i]));}return bookmarkElements;}
this.getBookmarkBounds=function(bookmarkElements){var x=this.getLeft(bookmarkElements[0]);var y=this.getTop(bookmarkElements[0]);var right=this.getRight(bookmarkElements[0]);var bottom=this.getBottom(bookmarkElements[0]);for(i=1;i<bookmarkElements.length;i++){x=Math.min(x,this.getLeft(bookmarkElements[i]));y=Math.min(y,this.getTop(bookmarkElements[i]));right=Math.max(right,this.getRight(bookmarkElements[i]));bottom=Math.max(bottom,this.getBottom(bookmarkElements[i]));}
var width=right-x-2*this.getBorderWidth();var height=bottom-y-2*this.getBorderWidth();return{'left':x,'top':y,'width':width,'height':height};}
this.getLeft=function(el){return _aspxGetAbsoluteX(el)-_aspxGetAbsoluteX(this.contentElement);};this.getTop=function(el){return _aspxGetAbsoluteY(el)-_aspxGetAbsoluteY(this.contentElement);};this.getWidth=function(el){return el.offsetWidth;};this.getHeight=function(el){return el.offsetHeight;};this.getRight=function(el){return this.getLeft(el)+this.getWidth(el);};this.getBottom=function(el){return this.getTop(el)+this.getHeight(el);};this.addBookmarkElement=function(bounds){var newEl=this.selectionTemplate.cloneNode(false);newEl.style.display='block';newEl.style.backgroundColor='';contentElement.appendChild(newEl);bounds.left-=this.getLeft(newEl);bounds.top-=this.getTop(newEl);newEl.style.width=_aspxGetValueWithPxUnit(bounds.width);newEl.style.height=_aspxGetValueWithPxUnit(bounds.height);newEl.style.position='relative';newEl.style.left=_aspxGetValueWithPxUnit(bounds.left);newEl.style.top=_aspxGetValueWithPxUnit(bounds.top);return newEl;}}
function aspxRVGotoBM(name,pageIndex,bookmarkIndices){var reportViewer=aspxGetControlCollection().Get(name);if(reportViewer!=null)reportViewer.GotoBookmark(pageIndex,bookmarkIndices);}