Ticket T441146
Visible to All Users
Duplicate

HttpContext null on preview from End-User ReportDesigner

created 8 years ago

Hello!

I use the End-User ReportDesigner and, for the preview, I load data from a complete list filtered by a specified type.

For my usage, this type is store in a cookie. This cookie is set on the start of the application and is used a lot of time. But when I want to display the preview of my report, I receive a NullReferenceException because HttpContext.Current is null. It looks like the HttpContext is lost for the preview of the report.

Could you tell me why? I join to this ticket a sample project which demonstrates the problem.

Thanks for your help!

Best regards!

Alex

Comments (1)
AB AB
Alexandre Blecich 8 years ago

    To be complete, I don't want to pass the type as parameter. The sample I send is a simple implementation of my problem, but it's more complexe in the reality. So, I need a way to recover this type from the HttpContext.

    Answers approved by DevExpress Support

    created 8 years ago (modified 8 years ago)

    Hi Alexandre,
    To accomplish your task, use the approach suggested in the How to access the values stored in HttpContext/Session while working with the ASP.NET HTML5 Document Viewer and End-User Report Designer controls article. Please refer to it and let us know if you need any additional assistance regarding this.
    Regards,
    Yaroslav

      Comments (3)
      AB AB
      Alexandre Blecich 8 years ago

        Thanks for your response.

        I've already read this article . I tried to implement the first solution (because I dont't want to use Parameter solutions) but I can't do working it.

        The best way is that you modify my sample project (joined to my first message) to implement the solution, because it's not very clear. It would be usefull for other developers too.

        Thanks for your help!

        Alex

        Yaroslav (DevExpress Support) 8 years ago

          I completely understand that you would rather avoid creating extra invisible report parameters for this task, Alexandre, but it's the only way to go. As mentioned in the thread linked above, the report generation is done in a separate thread where the session state is unavailable. This is a limitation of our web document viewer which is impossible to overcome at the moment.
          Regards,
          Yaroslav

          AB AB
          Alexandre Blecich 8 years ago

            Ok, I note that's a limitation.

            I've done an implementation which Parameter which is acceptable. It works.

            Thanks for your help!

            Alex

            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.