Editing Data with Microsoft SQL Server Reporting Services



Similar documents
Config Guide. Gimmal Smart Tiles (SharePoint-Hosted) Software Release 4.4.0

PORTAL ADMINISTRATION

Vector HelpDesk - Administrator s Guide

GP REPORTS VIEWER USER GUIDE

Using Application Insights to Monitor your Applications

SQL Server 2005 Reporting Services (SSRS)

Virto Pivot View for Microsoft SharePoint Release User and Installation Guide

BizTalk Server Business Activity Monitoring. Microsoft Corporation Published: April Abstract

1. To start Installation: To install the reporting tool, copy the entire contents of the zip file to a directory of your choice. Run the exe.

TROUBLESHOOTING GUIDE

Installation & User Guide

How-to Guide: Integrating Veeam ONE Reporting into Microsoft SharePoint

Embedding a Data View dynamic report into an existing web-page

2012 Teklynx Newco SAS, All rights reserved.

Smart Web. User Guide. Amcom Software, Inc.

Virtual Contact Center

SAS BI Dashboard 3.1. User s Guide

KFUPM. Web Content Management System powered by SharePoint

simplify printing TX Guide v. 1. make IT simple Tricerat, Inc Cronridge Drive Suite 100 Owings Mills, MD , All rights Reserved

Please contact Cyber and Technology Training at for registration and pricing information.

SAS BI Dashboard 4.3. User's Guide. SAS Documentation

Virtual Contact Center. Release Notes. Version Revision 1.0

HP Quality Center. Software Version: Microsoft Word Add-in Guide

WebFOCUS BI Portal: S.I.M.P.L.E. as can be

Developer Tutorial Version 1. 0 February 2015

1. Tutorial - Developing websites with Kentico Using the Kentico interface Managing content - The basics

TechTips. Connecting Xcelsius Dashboards to External Data Sources using: Web Services (Dynamic Web Query)

SAS BI Dashboard 4.4. User's Guide Second Edition. SAS Documentation

Business Insight Report Authoring Getting Started Guide

Novar Database Mail Setup Guidelines

SonicWALL GMS Custom Reports

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Richmond SupportDesk Web Reports Module For Richmond SupportDesk v6.72. User Guide

WP Popup Magic User Guide

IENG2004 Industrial Database and Systems Design. Microsoft Access I. What is Microsoft Access? Architecture of Microsoft Access

Tenrox and Microsoft Dynamics CRM Integration Guide

Ingenious Testcraft Technical Documentation Installation Guide

Monitoring Replication

Jeremy Kashel Tim Kent Martyn Bullerwell. Chapter No.2 "Master Data Services Overview"

DocAve 6 Service Pack 1 Job Monitor

Chapter 4: Website Basics

ImageNow Interact for Microsoft SharePoint Installation, Setup, and User Guide

Build Your First Web-based Report Using the SAS 9.2 Business Intelligence Clients

LearningServer Portal Manager

HOW TO CONFIGURE SQL SERVER REPORTING SERVICES IN ORDER TO DEPLOY REPORTING SERVICES REPORTS FOR DYNAMICS GP

SSRS Reporting Using Report Builder 3.0. By Laura Rogers Senior SharePoint Consultant Rackspace Hosting

All of the IntelliGanttt functions are accessed directly in Microsoft Project from the IntelliGanttt menu on the menu bar.

Mitigation Planning Portal MPP Reporting System

Top Navigation menu - Tabs. User Guide 1. &

Dev01: Kentico CMS 7 Developer Essentials Syllabus

On-premise and Online connection with Provider Hosted APP (Part 1)

Evaluator s Guide. PC-Duo Enterprise HelpDesk v5.0. Copyright 2006 Vector Networks Ltd and MetaQuest Software Inc. All rights reserved.

TIBCO Spotfire Metrics Prerequisites and Installation

Report Designer and Report Designer Add-In Installation Guide Version 1.0

HP Application Lifecycle Management

Virto SharePoint Gantt Chart App for Office 365 Release User and Installation Guide

jquery Tutorial for Beginners: Nothing But the Goods

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

DataPA OpenAnalytics End User Training

Create Reports Utilizing SQL Server Reporting Services and PI OLEDB. Tutorial

Appendix A How to create a data-sharing lab

2009 Braton Groupe sarl, All rights reserved.

SmartBar for MS CRM 2013

Dashboard Builder TM for Microsoft Access

SelectSurvey.NET Developers Manual

Search help. More on Office.com: images templates

NetWrix File Server Change Reporter. Quick Start Guide

Microsoft Access 2010 handout

Further web design: HTML forms

WHAT'S NEW IN SHAREPOINT 2013 WEB CONTENT MANAGEMENT

Integration Guide. Integrating Extole with Salesforce. Overview. Use Cases

Adaptive Enterprise Solutions

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

Bookstore Application: Client Tier

CA Clarity PPM. Connector for Microsoft SharePoint Product Guide. Service Pack

Connector for Microsoft Dynamics Configuration Guide for Microsoft Dynamics SL

SAHARA DIGITAL8 RESPONSIVE MAGENTO THEME

SQL Reporting Services: A Peek at the Power & Potential

HarePoint Workflow Scheduler Manual

ReportPortal Web Reporting for Microsoft SQL Server Analysis Services

Migration Instructions for MS Dynamics CRM

R i o L i n x s u p p o r r i o l i n x. c o m 1 / 3 0 /

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Dreamweaver CS5. Module 2: Website Modification

14 Configuring and Setting Up Document Management

TIBCO Spotfire Metrics Modeler User s Guide. Software Release 6.0 November 2013

graphical Systems for Website Design

How To Use Syntheticys User Management On A Pc Or Mac Or Macbook Powerbook (For Mac) On A Computer Or Mac (For Pc Or Pc) On Your Computer Or Ipa (For Ipa) On An Pc Or Ipad

Uni Sales Analysis CRM Extension for Sage Accpac ERP 5.5

Virtual Contact Center

Timeline for Microsoft Dynamics CRM

When a variable is assigned as a Process Initialization variable its value is provided at the beginning of the process.

ResPAK Internet Module

Using Adobe Dreamweaver CS4 (10.0)

Symantec Data Center Security: Server Advanced v6.0. Agent Guide

Business Portal for Microsoft Dynamics GP Field Service Suite

Transcription:

Editing Data with Microsoft SQL Server Reporting Services OVERVIEW Microsoft SQL Server Reporting Services (SSRS) is a tool that is used to develop Web-based reports; it integrates into MS Internet Information Server (IIS) and uses familiar MS Visual Studio as the report designer. A simple report in SSRS could be generated in minutes. SSRS can create advanced reports that allow the viewer to drilldown into deeper data such as sub-reports and graphs. It can be integrated into MS SharePoint Portal. SSRS is an integral and versatile part of MS SQL server included in all editions of MS SQL server, including the free "Express" edition. In some situations the end user may desire the ability to update and edit a report separate from the initial data entry and collection. For example one of DMC s clients wished to add additional data to comment fields and add missing that operators initially failed to input. The obvious, straight-forward solution would be to create a custom asp.net web page to replicate the report with editing capabilities. This is probably good solution for simple report, but re-creating a complex, deep report using asp.net could be time-consuming. The alternative solution DMC decided upon was to create a custom popup window (asp.net web page) with the few values needed to be edited and call this popup from SSRS report. There are several approaches to create popup window: Using hidden div element with editor popup and show it on the screen when needed. This approach required adding custom code to the report or wrapping the report into another page. Using the JavaScript function window.showmodaldialog. This function is Internet Explorer specific and isn't supported by other browsers. Also this function does not allow access to the parent window from the popup. Using the JavaScript function window.open DMC decided upon the JavaScript function window.open option because it is universal, supported by many browsers and allows access to the parent window from the popup (this allows to most of the JavaScript to reside in the popup window). Using a hidden div on the page is also good solution, but this approach would require adding JavaScript functions to the report. Some additional considerations need to be reviewed before implementing the popup editor solution: This solution is good if only a few items/values need to be edited in a complex report; If multiple values are to be edited in a simple report, the time spent to create custom popup could be comparable with the time needed to recreate the whole report in asp.net.

Thee popup needs to be an asp.net web page and has to be deployed on the same server/domain with SSRS The value to modify has to be stored in the database and the popup page needs access to this database The value to be modified must be identifiable; a unique identifier must be passed (the PK for the specific row in the table for example) to the popup in order to find the correct row record/values Following is an overview of the sequence of events that occur when a user uses the report editing popup: 1. User clicks on the report control element to be editedand the popup web page opens in a new window using URL link action and JavaScript 2. Row to edit identifier (row PK or similar) is passed to the popup in a query string 3. Popup opens in the middle of the screen 4. Popup opens modally (disables report page to prevent user to navigate out of the page, open another popup, etc.) 5. Popup creates/modifies data in the database 6. Popup refreshes report, after the user finishes editing and data is submitted to database 7. Popup re-enables report to allow user interaction with it Below are step by step instructions and code snippets to achieve this functionality. CALL EDITOR POPUP FROM SSRS AND PASS TABLE PK To open editor web page in new window use the Action properties of the SSRS control. In "jump to URL" JavaScript is needed to open the page in a new window. The PK value is added as a query string parameter to identify the row that needs to be edited; of course the PK value is optional and depends on your application. = "javascript:void window.open('http://myserver.org/reporteditor/usereditpopup.aspx?pk=" & Fields!PK. Value & "','_blank', 'status=0, location=0, menubar=0, toolbar=0, directories=0, resizable=0, scrollbars=0, width=100, height=100');" The JavaScript function window.showmodaldialog could be used instead of window.open, but showmodaldialog will work in IE onlyand doesn't allow access to the parent page from the child page (popup window in our case). Width and height parameters are not important as the popup window size is configured from the popup itself. RESIZE AND CENTER POPUP, DISABLE REPORT FROM THE POPUP Because we don't set the popup size from the report, we use the JavaScript function to set the popup window size and position.

function WindowSetSize() { // Seems like DocumentElement has proper size in IE var docelem = document.documentelement; // Scroll width/height is size of the whole document; // Client width/height is browser window size // Scroll width should be set by body style width; // Scroll height calculated automatically by page size var iwidth = docelem.scrollwidth - docelem.clientwidth; var iheight = docelem.scrollheight - docelem.clientheight; // Resize window to be exact size of the document window.resizeby(iwidth, iheight); // Move window to the center of the screen window.moveto((screen.width-docelem.clientwidth) / 2, (screen.height-docelem.clientheight) / 2); The following JavaScript function is used in the popup window to disable (gray-out) the report. The function creates a grey div element in the parent window with 50% transparency and places this div on the other elements. Please note that in order to access parent window from the popup both of them should be on the same domain. function ParentWindowGrayOut(){ // Be sure parent window exists if (window.opener) { // Parent window exists; try to get gray div element from parent window var divelem = window.opener.document.getelementbyid('graydiv'); // Verify gray element is exists if (!divelem) { // Gray div does not exists, create it divelem = window.opener.document.createelement('div'); divelem.id = 'GrayDiv'; // Set element name // Get body element and add new div to it var bodyelem = window.opener.document.getelementsbytagname("body")[0]; bodyelem.appendchild(divelem);

// Apply style to this new div divelem.style.position = 'absolute'; divelem.style.top = '0px'; divelem.style.left = '0px'; // Clip the content of the original document // Shouldn't show anything outside the new div divelem.style.overflow = 'hidden'; // Set filter to be 50% transparent divelem.style.filter = 'alpha(opacity=50)'; // This should be high enough to be on the top of every other elements divelem.style.zindex = 100; divelem.style.backgroundcolor = '#000000'; // Get parent window size var docelem = window. opener. document. documentelement; divelem. style. width = docelem. scrollwidth; divelem. style. height = docelem. scrollheight; divelem. style. display = 'block'; We have to call both JavaScript functions on the page load event. MODIFY DATA IN THE DATABASE The popup window is just a standard aspx (or php if you prefer) page, so you have full asp.net toolbox for your disposal to enter/validate/modify data in database. Close popup window, refresh report data and re-enable report When the user is done editing data and all data is committed to the database the popup window needs to be closed from code behind. To do so use the RegisterStartupScrip method, (below is an example in VB). ClientScript.RegisterStartupScript(Me.GetType(), "CloseScript01", "window.close();", True) The report needs to be enabled in the parent window in any case, even if the popup is closed by the close window ( X )

button. JavaScript exposes the "window.onbeforeunload" event exactly for this purpose. When this event fires the parent window must be re-enabled using the JavaScript function "ParentWindowUnGray". This function removes the div element created by the "ParentWindowGrayOut" function. It does not actually delete div element, but sets its style to "none". function ParentWindowUnGray() { // Be sure parent window exists if (window.opener) { // Parent window exists; try to get gray div element from parent window var divelem = window.opener.document.getelementbyid('graydiv'); // Verify gray element is exists; If it doesn't, we have nothing to ungrey if (divelem) { // Gary div was created before, don't display it divelem.style.display = 'none'; The report must be refreshed. I found at least three methods for doing this: two for pure Reporting Services and another one for a report embedded into DotNetNuke using the SQLRS module. We should try all methods. if (window.opener) { // Seems like there are two methods to refresh report, try both if (window.opener.window.actionhandlerreportviewercontrol!= null) { window.opener.window.actionhandlerreportviewercontrol('refresh', null); else if (window.opener.document.getelementbyid('reportviewercontrol')!= null) { window.opener.document.getelementbyid('reportviewercontrol').clientcontroller.actionhandler('refresh', null) else { // Seems like DNN Report Viewer 2005 creates div with id "x_viewrs2005_reportviewer_x" // If such div exists we have to call "ClientController.ActionHandler('Refresh', null)" var AllDiv = window.opener.document.getelementsbytagname('div') for (var i = 0; i < AllDiv.length; i++) { if (AllDiv[i].id.indexOf("ViewRS2005_ReportViewer") >= 0) { if (AllDiv[i].ClientController) { AllDiv[i].ClientController.ActionHandler('Refresh', null);

OTHER CONSIDERATIONS The above code is enough to have basic popup functionality. It could be extended to have better visual effects such as popup window animation, prevention from the popup loosing focus, etc. In order to prevent the popup window from loosing focus, the window.onblur event should be handled to set focus back to the popup. window.onbeforeunload event fires in case of the post-back, which causes the report to refresh/flicker. In order to handle this situation properly we set a JavaScript global variable in the onclick event of any controls causing a post back and evaluate this variable before enabling/refreshing the report. Copyright 2014 DMC, Inc. All rights reserved. No portions of this document may be reproduced without prior written consent of DMC, Inc. Specifications are subject to change without notice. All brands or products are trademarks or registered trademarks of their respective holders and should be treated as such.