Ticket T348757
Visible to All Users

How can we pass custom information to a custom ReportStorageWebExtension

created 9 years ago

Hi

I'm trying to create a custom storage for report data in an ASP.NET MVC app. The custom ReportStorageWebExtension that I need, requires some additional information that can only be passed as a part of the url (as a url fragment). However, it seems the extension gets called from a different point in the processing pipeline & neither an actionfilter nor an httpmodule (I've tried both) gets called when any of the methods on the custom ReportStorageWebExtension gets called.

What is the recommended way to intercept calls made to the custom ReportStorageWebExtension so that additional information can be parsed from the route url & fed to it?

Indranil

Answers approved by DevExpress Support

created 9 years ago

Hi Indranil,

The ReportStorageWebExtension methods are executed in a separate HTTP module, so it is not possible to access your application's URL parameters there. In any case, you can make your application's HttpContext Session data available in this HTTP module by using the approach demonstrated in the T339643: How to access the values stored in HttpContext/Session while working with the ASP.NET HTML5 Document Viewer and End-User Report Designer controls KB article. So, by using this approach, you will be able to pass required information to the ReportStorageWebExtension by using the Session.

    Other Answers

    created 4 years ago (modified 4 years ago)

    Hi,

    I had this same issue - and enabling HTTP session state is a rather heavy-handed solution. HTTP session state is best avoided for scalability reasons - and if you've managed to avoid it for the rest of your application, it's a real shame to have to pull it in for this one component.

    Here is another solution - intercepting all the DX ajax calls to inject your necessary data as headers.

    This example is coded in TS - but you can adapt if you're using pure JS.
    Here I am injecting both my authentication token, and additional data.

    TypeScript
    // override DevExpress ajax to inject requisite headers let dxSendRequest = DevExpress.Analytics.Utils.ajaxSetup.sendRequest; DevExpress.Analytics.Utils.ajaxSetup.sendRequest = function (settings: JQueryAjaxSettings) { settings.headers = { 'Authorization': 'Bearer ' + _tokenService.getToken(), 'ReportStorageSubfolder': _reportStorageFolderService.getActiveFolder() }; return dxSendRequest(settings); }

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.