ReportViewer Control

Discussion in 'ASP.NET 2.0' started by Bruce, Mar 15, 2006.

  1. Bruce

    Bruce DiscountASP.NET Staff

    We have recently added ReportViewer Control to our web server.

    Report Viewer control allows you to render reports built with Visual Studio 2005?s Report Designer. It is a real cool and simple way to build professional reports.

    I was going to write a tutorial on how to use this control but I found a very good site that covers almost every aspects of ReportViewer control. The site is www.gotreportviewer.com

    You can also review official reference at MS site - msdn2.microsoft.com/en-us/library/ms251671(en-US,VS.80).aspx

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  2. I'm using Visual Studio 2005 to create an ASP.Net 2.0 app written in VB. I am using a ReportViewerControl and it works locally but I get errors when I publish my site. Do I need to reference the ReportViewerControl differently on the server than I do locally?

    Thanks,
    Patrick
     
  3. Sorry. I thought I had put the error message in my post but I guess it just in my head. In a nut shell, I get the following error:

    The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

    The link of my test page is http://www.xcelenergyefficiency.com/pdftest

    Post Edited By Moderator (Joel Thoms) : 7/20/2006 9:26:43 PM GMT
     
  4. It's probably some permission issue on the web server. Please create a support ticket.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanks for the reply. Ironically, I had created a support ticket about the same time I posted my first comment in the forum. Support told me that programming issues should be posted in the forum.

    Patrick
     
  6. My initial issue has been solved. I have a new issue though. I have code that will render the report generated by my ReportViewer Control as a PDF file when the page is opened. It works fine in Firefox but in IE I get a blank page.

    Patrick
     
  7. It's probably a content-type issue. What content-type is the server rendering to the client?


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  8. The contentType I'm using is "application/pdf"
     
  9. Ok, that is the correct content-type. I just went to your URL and the PDF pulled up in my browser (IE).


    Try installing the latest version of adobe pdf reader.



    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  10. Please disregard my last post. I tried my app on another computer and it worked in both browsers. Thank you for you time and help.


    Patrick
     
  11. I'm sorry, I didn't clarify which URL I was having the difficulty. The one you tried does work in both browsers. However, that is a test code. I incorporated the functionality into another project and that is where I am having the difficulty. The new site requires I login. I can create a dummy login for you if that will help you test.

    Patrick
     
  12. bruce [DASP] said...
    We have recently added ReportViewer Control to our web server.

    Report Viewer control allows you to render reports built with Visual Studio 2005?s Report Designer. It is a real cool and simple way to build professional reports.

    I was going to write a tutorial on how to use this control but I found a very good site that covers almost every aspects of ReportViewer control. The site is www.gotreportviewer.com

    You can also review official reference at MS site - msdn2.microsoft.com/en-us/library/ms251671(en-US,VS.80).aspx



     
  13. Bruce

    Bruce DiscountASP.NET Staff

    I think you got this confused.


    Reporting Service is a report engine whereas ReportViewer control allows you to display report on your website. They are 2 different things even though they take the same report definition file.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  14. <...The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)...>


    Ditto on the above from another poster. While I am successful in displaying the Report Viewer (RV) control &amp; its contents, the problem above and other related control behavioral problems are spurious (andunsustainable in the production app, as presented to the general public).


    Background : I recently upgraded to NET 2.0/DNN 4.3.5 on my development machine (localhost), another (test remote) host site, and at dASP -- and intend toinclude as part of the production app, the RV control - which renders a report that is (always) 2 pages, the content based on the response to 3 SQL selects/data sources.


    The RV control's behavior performs admirablyon the dev. machine, other test remote site -- allexcept at dASP =>the "...The specified module could not be found/HRESULT: 0x8007007E...".


    Other spurioussymptoms : Roughly half the time, the RV control, on a refresh or "next page" will disable the tool bar commands. For example, occasionally, page navigation to the 2nd page of the report will correctly fill the RV contents, but the redisplayed tool barwill show the report containing"0 pages" (which disables further navigation).


    Somehow I think there is a timing (or timeout) issue (due to spurious nature of the problem) and so, I've tested with the Report Viewer's property setting Async Rendering both True and False.


    ----------------------------------------------------------------------------------------------------


    Other info:


    As part of web.config (is the following correct?)...


    <httpHandlers>
    ...


    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </httpHandlers>


    The following error message will sometime appearin the Report Viewer, providing ASP.NET stack trace.


    Server Error in '/RP' Application.
    ------------------------------------------------------------------------------


    ASP.NET session has expired
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


    Exception Details: Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired


    Source Error:


    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:


    [AspNetSessionExpiredException: ASP.NET session has expired]
    Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +686
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64


    ...>


    DNN also provides its own stack trace (which is best read, bottoms-up) -- and this seems to point the problem between Report Viewer and the NET framework.


    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP.portals__default_skins_salarocrystal_admin_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---


    -----------------------------------------------------------------------------


    This is probably not an easy problem to resolve, but any help/suggestions/pointers on this would be appreciated.
     
  15. Do you have the following dll's in your bin?


    Microsoft.ReportViewer.WebForms.dll ,Microsoft.ReportViewer.Common.dll ,Microsoft.ReportViewer.ProcessingObjectModel.dll



    In reference to the later problem,are you using cookieless sessions?If yes,try using cookies by setting cookieless="false" in your web.config.I believe there is a bug with the reportviewer control using cookieless sessions.







    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 11/12/2006 8:16:57 PM GMT
     
  16. Vikram: Thanks for your response.

    <...Do you have the following dll's in your bin?


    Microsoft.ReportViewer.WebForms.dll ,Microsoft.ReportViewer.Common.dll ,Microsoft.ReportViewer.ProcessingObjectModel.dll ...>


    No. I checked my other web-sites (localhostas well asanother remote ASP.NET 2.0 host, similarly DNN/app configured).The components you mention above are not present in their bin directories. I'm reluctant to add/change configuration in the bin unless it is clearly mandated --at least until other avenues have been pursued. Thisincludes dASP's tech support's statedwillingnessto replicate error &amp; review. Therefore, I'll hold the suggestion of placing these components in the bin onmy "to do" list.


    I've even done different permutations of the Report Viewer control, from the very simple to more complex (incl. the use of document maps, which isn't allthat "complex" IMO) - but none of this seems to make a difference.


    Reading MS docs of Report Viewer control &amp; configuration, the application developerhas to determine whether to use the control feature "Async Rendering" or not. In my case, it's set at the default ("True").


    <...In reference to the later problem,are you using cookieless sessions?If yes,try using cookies by setting cookieless="false" in your web.config.I believe there is a bug with the reportviewer control using cookieless sessions...>
    Myweb.config follows( to support DNN ) - all sites are similar.

    <authentication mode="Forms">
    <forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies"/>
    </authentication>
     
  17. I think one thing that I discovered about Report Viewer control within DNN, is...


    ...NOT to apply any caching to any DNN module hostingthe Report Viewer control ! (Why that was applied in the 1st place - I dunno )


    Eliminating caching stabilizes the behavior. Still,under stress testing, it does not completely eliminate instances of the "ASP.NET session has expired" phenomenon (which I still encounter only at dASP).


    IMO, the implementation of MS's R.V. control (local, with setting options) under DNN (4.x), shared hosting, etc. is a potential field of landminds -- as there are configurabilty options that you trip up in any of these components.
     
  18. Hi, I need some help with an issue i'm having. I'm also using report viewer tool in an application i have hosted in aspdiscount hosting. When i try to export a large report in a pdf format file the application throws the exception "ASP.NET session expired". do you have any ideas why could it be? I already published the application in a testing IIS and i don't have that problem, do you think aspdiscount has asize restriction when exporting large reports?
     
  19. <...do you have any ideas why could it be? I already published the application in a testing IIS and i don't have that problem, do you think aspdiscount has a size restriction when exporting large reports?...>

    Despite my earlier issues with R.V., I was able to get R.V. to work reliably for a 'simple view' that has 3 SQL queries, one of which fills a graph, the other 2 fills text areas.

    What my app paints inside the R.V. is only one page, the summary page of ~20 page detailed PDF report. As a side note, the PDF report is normally 500K should the user the PDF and auto-opens an Adobe reader. As a guesstimate then, the R.V. contents might only be 50K (500K/20 pages & allow for 'doubling' for the graphic).

    Since last posting to the forum, I did discover that one of the issues I initially had was that my code was attempting to render the page 2x (but I can't for the life remember why this was happening). So there actually 2 (async?) requests outstanding per (logical) page - that, quite possibly, 2 responses came back (possibly out-of-order) - that I later presumed may have been the cause of the ASP.NET session expiration. Once I made the correction (whatever that was), the R.V. behavior stabilized.

    You may want to walk through your debugger locally to make sure 2 requests (page loads) is not happening. The ASP.Net session expiration problem did not occur during local IIS testing.

    Of course, my experience may have nothing to do with your problem. I also made other corrections/optimizations that may have cured the problem, such as optimizing SQL queries that feed the R.V. report (but I think this was only 'marginal').
     
  20. well, i have checked the code and it is as efficient as it could be.


    The problem is that a lot of information has to be exported, so the pdf report is almost 200 pages long. There's no optimization issues here because the info that has to be exported is the one that is neededas it is the one required by the clients using the application so i want to know if there's a solution. Otherwise i'm in trouble.
     
  21. Bruce

    Bruce DiscountASP.NET Staff

    In your test server, were you able to monitor the memory usage.

    I have a feeling that the report viewer control creates the pdf on the fly and thus stored it in memory of the worker process.

    If you see sustained memory usage of over 100MB, you will hve problem using this on our server.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  22. This was it. Thanks a LOT. It worked OK for me.
    Mike.
     
  23. Dear All,

    I have created application in VS 2005 using ASP.net 2.0 and VB.NET 2005. I have used Microsoft Reporting i.e. *.rdlc and its report Viewer, Report processing Mode is local (not remote). I was working fine on local machine and on Intranet.

    When i had uploaded the project on discountasp.net account. following error was raising.
    ********************************************************
    The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.IO.FileNotFoundException: The specified module
    could not be found. (Exception from HRESULT: 0x8007007E)
    Source Error:
    An unhandled exception was generated during the execution of the current
    web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [FileNotFoundException: The specified module could not be found.
    (Exception from HRESULT: 0x8007007E)]
    ......
    ......
    ********************************************************

    We contacted to discount Asp support and they resolved the same by setting permission to one of their system DLL.

    Now New error is coming.
    Error is ........
    ******************************************
    An error has occurred during report p[​IMG]rocessing.
    Exception has been thrown by the target of an invocation.
    Object reference not set to an instance of an object.
    ******************************************

    Again we contacted to discount asp and they redirected us to here.
    Here I am giving you the detail of my *.Aspx code of Report Viewer form, no code is written in code behind
    And its working fine locally and on Intranet.

    *.aspx code View of Report Viewer Form
    *******************************************************************************
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Report_EnglishInvoice.aspx.vb" Inherits="Web_Pages_Reports_Report_EnglishInvoice" %>
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>EXFP - English Invoice</title>
    </head>

    <form id="form1" runat="server">
    <div>
    <table style="width:auto">
    <tr>
    <td align="center" style="width: 100%; text-align: left;" valign="top">
    &amp;nbsp;<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
    Font-Size="8pt" Height="800px" ShowFindControls="False" ShowPromptAreaButton="False"
    ShowRefreshButton="False" Width="800px">
    <LocalReport ReportPath="Web_Pages\Reports\Report_EnglishInvoice.rdlc">
    <DataSources>
    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="ReportDataSet_Report_DT_EnglishInvoice" />
    </DataSources>
    </LocalReport>
    </rsweb:ReportViewer>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData"
    TypeName="ReportDataSetTableAdapters.Report_DT_EnglishInvoiceTableAdapter" OldValuesParameterFormatString="original_{0}">
    <SelectParameters>
    <asp:SessionParameter Name="ord_ID" SessionField="Report_EI_OrdID" Type="Int32" />
    </SelectParameters>
    </asp:ObjectDataSource>
    &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>
    ***************************************************************************************
    please check out this error and guide me what should i do to resolve this problem, and if I am doing some thing wrong then provide me the sample code, how to do the same in correct way, although the above application is working fine locally and on Intranet.

    Regards,
    Muhammad Zahid Iqbal
    Emmaculate
     

Share This Page