Académique Documents
Professionnel Documents
Culture Documents
{
var control = document.getElementById(controlID);
if (control == null)
alert("Unable to locate control: " + controlID);
return control;
}
function IsIEBrowser()
{
if (navigator.appName.indexOf("Microsoft") != -1)
return true;
else
return false;
}
// If the null checkbox itself is not enabled, don't change the state
// of the parameter controls. The null check box is disabled when
// a data driven parameter has an outstanding dependencies
if (nullChkBox.disabled)
return;
control.disabled = shouldDisable;
}
RSParameters.prototype.DisableTextInput = DisableReportViewerTextInput;
function RSP_HideActiveDropDown()
{
if (this.ActiveDropDown != null)
this.ActiveDropDown.Hide();
}
RSParameters.prototype.HideActiveDropDown = RSP_HideActiveDropDown;
function RSP_OnActiveDropDownHidden(previouslyVisibleDropDown)
{
// Check that it is still listed as active, in case event ordering
// caused the show on the new one to fire first
if (this.ActiveDropDown == previouslyVisibleDropDown)
this.ActiveDropDown = null;
}
RSParameters.prototype.OnActiveDropDownHidden = RSP_OnActiveDropDownHidden;
function RSP_SetNewActiveDropDown(newDropDown)
{
// Hide the previously visible dropDown
if (this.ActiveDropDown != newDropDown && this.ActiveDropDown != null)
this.ActiveDropDown.Hide();
this.ActiveDropDown = newDropDown;
}
RSParameters.prototype.SetNewActiveDropDown = RSP_SetNewActiveDropDown;
function OnChangeCredentialsClicked()
{
// Hide the link
event.srcElement.style.display = "none";
function ShouldValidateCredentials()
{
// Get the credential link
var credentialLink = document.getElementById(this.m_credentialLinkID);
function DoesInputHaveValue(elementID)
{
var element = document.getElementById(elementID);
return false;
}
RSParameters.prototype.DoesInputHaveValue = DoesInputHaveValue;
if (trueElement.checked || falseElement.checked)
return true;
return false;
}
RSParameters.prototype.DoesBooleanHaveValue = DoesBooleanHaveValue;
return true;
}
RSParameters.prototype.ValidateDropDown = ValidateDropDown;
function OnLoadReport(reloadDocMap)
{
this.m_clientController.OnReportLoaded(this, reloadDocMap);
if (this.m_autoRefreshAction != null)
setTimeout(this.m_autoRefreshAction, this.m_autoRefreshInterval);
}
RSReport.prototype.OnLoadReport = OnLoadReport;
function UpdateZoom(paramZoomValue)
{
if (paramZoomValue != null)
zoomValue = paramZoomValue;
else if (this.m_lastZoomValue != null)
zoomValue = this.m_lastZoomValue;
else
// Zoom should be set initially during OnLoad. Until then, ignore calls
from toolbar/resize event
return;
if (paramZoomValue != null)
this.m_lastZoomValue = paramZoomValue;
}
RSReport.prototype.UpdateZoom = UpdateZoom;
function ReportFindNext ()
{
// Unhighlight previous hit, if any.
if (this.m_nextHit > 0)
{
var hitElem = document.getElementById(this.m_reportPrefix + "oHit" +
(this.m_nextHit - 1));
if (hitElem != null)
{
hitElem.style.backgroundColor = "";
hitElem.style.color = "";
}
}
this.m_nextHit ++;
return true;
}
RSReport.prototype.FindNext = ReportFindNext
function OnFrameVisible()
{
// In async mode, fit proportional must happen after the report frame
// becomes visible, otherwise images dimensions are 0. In sync mode
// it is handled inline in the renderer.
if (typeof(ResizeImages) == "function") // Make sure it is defined
ResizeImages();
this.UpdateZoom(this.m_initialZoomValue);
}
RSReport.prototype.OnFrameVisible = OnFrameVisible
// Calculated property
if (this.m_docMapReportFrameID == "")
this.IsAsync = false;
else
this.IsAsync = true;
}
if (this.CanHandleClientSideAction(actionType))
{
// Construct the url
var actionUrl = this.m_baseReportPageUrl + "&" +
this.CommonReportPageQueryParams();
actionUrl += "&ActionType=" + encodeURIComponent(actionType);
actionUrl += "&ActionParam=" + encodeURIComponent(actionParam);
if (this.CurrentPage != null)
actionUrl += "&PageNumber=" + encodeURIComponent(this.CurrentPage);
function CanHandleClientSideAction(actionType)
{
if (actionType == "Toggle")
return this.m_canHandleToggleOnClient;
else if (actionType == "Bookmark")
return this.m_canHandleBookmarkOnClient;
else if (actionType == "DocumentMap")
return this.m_canHandleDocMapOnClient;
else if (actionType == "Sort")
return this.m_canHandleSortOnClient;
else if (actionType == "Search")
return this.m_canHandleSearchOnClient;
else if (actionType == "SearchNext")
return this.m_canHandleSearchOnClient;
else if (actionType == "Refresh")
return this.m_canHandleRefreshOnClient;
else if (actionType == "PageNav")
return this.m_canHandlePageNavOnClient;
else
return false; // Drillthrough
}
RSClientController.prototype.CanHandleClientSideAction = CanHandleClientSideAction;
// Update the client side page number so that it is available to the server
object
// if it was changed asynchronously.
var clientCurrentPage = GetControl(this.m_clientCurrentPageID);
if (clientCurrentPage != null)
clientCurrentPage.value = this.CurrentPage;
docMapReportFrame.frames["docmap"].location.replace(this.m_docMapUrl);
}
this.CustomOnReloadDocMap();
}
this.CustomOnReportLoaded();
}
RSClientController.prototype.OnReportLoaded = OnReportLoaded;
function OnReportFrameLoaded()
{
this.m_reportLoaded = true;
this.ShowWaitFrame(false);
if (this.IsAsync && this.m_reportObject != null)
this.m_reportObject.OnFrameVisible();
}
RSClientController.prototype.OnReportFrameLoaded = OnReportFrameLoaded;
function RVCC_CanDisplayBuiltInDocMap()
{
return this.IsAsync;
}
RSClientController.prototype.CanDisplayBuiltInDocMap =
RVCC_CanDisplayBuiltInDocMap;
function RVCC_HasDocumentMap()
{
if (this.m_reportObject != null)
return this.m_reportObject.m_hasDocMap;
else
return false;
}
RSClientController.prototype.HasDocumentMap = RVCC_HasDocumentMap;
function DelegateZoomChange(zoomValue)
{
this.m_reportObject.UpdateZoom(zoomValue);
// Set the zoom value to the last one on the report object instead
// of the parameter so that it only gets set if it is valid.
this.m_zoomValue = this.m_reportObject.m_lastZoomValue;
}
RSClientController.prototype.SetZoom = DelegateZoomChange;
function RSCC_CurrentZoom()
{
var zoomValue = null;
if (this.m_zoomValue != null)
zoomValue = this.m_zoomValue; // Might be null if zoom was never changed on
the client
if (zoomValue == null && this.m_reportObject != null)
zoomValue = this.m_reportObject.m_initialZoomValue;
if (zoomValue == null)
zoomValue = "100";
return zoomValue;
}
RSClientController.prototype.CurrentZoom = RSCC_CurrentZoom;
function ShowInitialWaitFrame()
{
if (!this.m_reportLoaded)
this.ShowWaitFrame(true);
}
RSClientController.prototype.ShowInitialWaitFrame = ShowInitialWaitFrame;
function ShowWaitFrame(startShowingWaitFrame)
{
// Check for synchronous processing
if (!this.IsAsync)
return;
var waitControl = document.getElementById(this.m_waitControlID);
if (!waitControl)
return;
if (startShowingWaitFrame)
{
waitControl.style.display = "inline";
reportFrame.style.display = "none";
}
else
{
waitControl.style.display = "none";
reportFrame.style.display = "inline";
}
}
RSClientController.prototype.ShowWaitFrame = ShowWaitFrame;
function SetDocMapVisibility(makeVisible)
{
var docMapReportFrame = frames[this.m_docMapReportFrameID];
var frameset = docMapReportFrame.GetFrameSet();
var reportFrame = docMapReportFrame.GetReportFrame();
var docMapVisibilityState =
document.getElementById(this.m_docMapVisibilityStateID);
if (makeVisible)
{
frameset.cols = this.m_docMapSize + ",*";
frameset.frameSpacing = "3";
reportFrame.noResize = null;
docMapVisibilityState.value = "false";
}
else
{
frameset.cols = "0,*";
frameset.frameSpacing = "0";
reportFrame.noResize = "true";
docMapVisibilityState.value = "true";
}
this.m_docMapVisible = makeVisible;
this.CustomOnDocMapVisibilityChange();
}
RSClientController.prototype.SetDocMapVisibility = SetDocMapVisibility;
function IsDocMapVisible()
{
var docMapReportFrame = frames[this.m_docMapReportFrameID];
if (docMapReportFrame == null)
return false;
return !reportFrame.noResize;
}
RSClientController.prototype.IsDocMapVisible = IsDocMapVisible;
function RSCC_HandleSearchNext()
{
if (this.m_reportObject != null)
{
if (!this.m_reportObject.FindNext())
this.ActionHandler("SearchNext", this.m_searchStartPage + "_" +
this.m_reportObject.m_searchText);
}
}
RSClientController.prototype.HandleSearchNext = RSCC_HandleSearchNext;
function RSCC_CanContinueSearch()
{
if (this.m_reportObject != null)
return this.m_reportObject.m_searchStartPage > 0;
else
return false;
}
RSClientController.prototype.CanContinueSearch = RSCC_CanContinueSearch;
function PerformClientSidePageChange(url)
{
this.CustomOnAsyncPageChange();
function CommonReportPageQueryParams()
{
var zoomValue = this.CurrentZoom();
var zoomMode = "Percent";
var zoomPercent = "100";
if (zoomValue == "PageWidth" || zoomValue == "FullPage")
zoomMode = zoomValue;
else
zoomPercent = zoomValue;
function RSCC_LoadPrintControl()
{
var printFrame = document.getElementById(this.m_printFrameId);
if (printFrame != null)
{
if (printFrame.src != this.m_printHtmlLink)
window.frames[this.m_printFrameId].window.location.replace(this.m_printHtmlLink);
else
eval(this.m_printFrameId + ".Print();");
}
return false;
}
RSClientController.prototype.LoadPrintControl = RSCC_LoadPrintControl;
function RSCC_SetPromptAreaVisibility(makeVisible)
{
var parametersRow = document.getElementById(this.m_promptAreaRowId);
if (parametersRow == null)
return;
var promptVisibilityState =
document.getElementById(this.m_promptVisibilityStateId);
if (makeVisible)
{
parametersRow.style.display = "";
promptVisibilityState.value = "false";
}
else
{
parametersRow.style.display = "none";
promptVisibilityState.value = "true";
}
this.CustomOnPromptAreaVisibilityChange();
}
RSClientController.prototype.SetPromptAreaVisibility =
RSCC_SetPromptAreaVisibility;
function RSCC_ArePromptsVisible()
{
var promptVisibilityState =
document.getElementById(this.m_promptVisibilityStateId);
return promptVisibilityState.value == "false";
}
RSClientController.prototype.ArePromptsVisible = RSCC_ArePromptsVisible;
if (this.m_activeLinkStyle != "")
this.m_isUsingStyles = true;
else
this.m_isUsingStyles = false;
}
function ReportViewerLinkIsViewerLinkActive()
{
return this.m_isActive;
}
ReportViewerLink.prototype.IsViewerLinkActive = ReportViewerLinkIsViewerLinkActive;
function ReportViewerLinkSetViewerLinkActive(isActive)
{
var button = GetControl(this.m_linkID);
if (button == null)
return;
this.m_isActive = isActive;
this.OnLinkNormal();
}
ReportViewerLink.prototype.SetViewerLinkActive =
ReportViewerLinkSetViewerLinkActive;
function ReportViewerLinkOnLinkHover()
{
if (this.m_isUsingStyles)
return;
if (this.m_isActive)
{
link.style.textDecoration = "underline";
link.style.color = this.m_activeHoverLinkColor;
link.style.cursor = "pointer";
}
else
link.style.cursor = "default";
}
ReportViewerLink.prototype.OnLinkHover = ReportViewerLinkOnLinkHover;
function ReportViewerLinkOnLinkNormal()
{
if (this.m_isUsingStyles)
return;
if (this.m_isActive)
link.style.color = this.m_activeLinkColor;
else
link.style.color = this.m_disabledLinkColor;
link.style.textDecoration = "none";
}
ReportViewerLink.prototype.OnLinkNormal = ReportViewerLinkOnLinkNormal;
if (this.m_normalStyle != "")
this.m_isUsingStyles = true;
else
this.m_isUsingStyles = false;
}
function ReportViewerHoverButtonOnHover()
{
var button = GetControl(this.m_buttonID);
if (button == null)
return;
if (this.m_isUsingStyles)
button.className = this.m_isPressed ? this.m_hoverPressedStyle :
this.m_hoverStyle;
else
{
button.style.border = this.m_isPressed ? this.m_hoverPressedBorder :
this.m_hoverBorder;
button.style.backgroundColor = this.m_isPressed ?
this.m_hoverPressedColor : this.m_hoverColor;
button.style.cursor = "pointer";
}
}
ReportViewerHoverButton.prototype.OnHover = ReportViewerHoverButtonOnHover;
function ReportViewerHoverButtonOnNormal()
{
var button = GetControl(this.m_buttonID);
if (button == null)
return;
if (this.m_isUsingStyles)
button.className = this.m_isPressed ? this.m_hoverStyle :
this.m_normalStyle;
else
{
button.style.border = this.m_isPressed ? this.m_hoverBorder :
this.m_normalBorder;
button.style.backgroundColor = this.m_isPressed ? this.m_hoverColor :
this.m_normalColor;
button.style.cursor = "default";
}
}
ReportViewerHoverButton.prototype.OnNormal = ReportViewerHoverButtonOnNormal;
function ReportViewerHoverButtonSetPressed(isPressed)
{
this.m_isPressed = isPressed;
this.OnNormal();
}
ReportViewerHoverButton.prototype.SetPressed = ReportViewerHoverButtonSetPressed;
function RVTB_SetHasDocMap(docMapGroupId)
{
var docMapGroup = document.getElementById(docMapGroupId);
if (docMapGroup != null)
{
// Make the button visible
docMapGroup.style.display = "inline";
// Make sure there is a spacer (there won't be in the docmap is the only
button), and make it visible
var docMapSpacer = docMapGroup.nextSibling;
if (docMapSpacer != null && docMapSpacer.ToolbarSpacer == "true")
docMapSpacer.style.display = "inline";
}
}