Help with Report Viewer using Asp.net webform

4 posts, 0 answers
  1. David
    David avatar
    19 posts
    Member since:
    Feb 2015

    Posted 26 Jul Link to this post

    Can someone provide a demo with using the asp.net Webform viewer?  I realize this is a legacy control but I wanted to try this one first before tackling the HTML 5 viewer.

     

    I have created a simple Crosstab report with nothing but a crosstab object and a textbox title.  I have assigned the report to a ObjectDataSource to a custom business data entity class with public properties although I did not use any of the fields.  I just want to be able to load this report with the header text using that viewer.

    Below is the HTML and code behind for the report viewer:

    <form id="form1" runat="server">
      
            <telerik:ReportViewer ID="ReportViewer1" runat="server">
                
            </telerik:ReportViewer>
      
        </form>

    protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    var typeReportSource = new Telerik.Reporting.TypeReportSource();
                    typeReportSource.TypeName = "QuiCx.Web.Pages.Demos.KendoReporting.CrossTab";
                    this.ReportViewer1.ReportSource = typeReportSource;
                }
            }

     

    When I run the report viewer I get this error:

    Invalid report type
    Value cannot be null.
    Parameter name: type
    at Telerik.Reporting.Processing.TypeReportDocumentResolver.Resolve(IProcessingContext context, TypeReportSource rs)
    at Telerik.Reporting.Processing.ReportDocumentResolver`1.Telerik.Reporting.Processing.IReportDocumentResolver.Resolve(IProcessingContext context, ReportSource rs, Boolean loadParameters)
    at Telerik.Reporting.Processing.ReportDocumentResolver.<>c__DisplayClass1.<Resolve>b__0(IReportDocumentResolver r)
    at Telerik.Reporting.Processing.ReportDocumentResolver.Bind[T](IProcessingContext context, ReportSource source, Func`2 func)
    at Telerik.Reporting.Processing.ReportDocumentResolver.Resolve(IProcessingContext context, ReportSource source, Boolean loadParameters)
    at Telerik.ReportViewer.WebForms.ParametersPage.ResolveReportDocument(ReportSource reportSource)
    at Telerik.ReportViewer.WebForms.ParametersPage.get_ReportDocument()
    at Telerik.ReportViewer.WebForms.ParametersPage.get_ParamsManager()
    at Telerik.ReportViewer.WebForms.ParametersPage.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at Telerik.ReportViewer.WebForms.ParametersPage.OnPreLoad(EventArgs e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

     

     

    Can someone point me in the right direction?  The demos provided does not use this report viewer.  All of them use the HTML 5 viewer.

     

  2. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 27 Jul Link to this post

    Hello David,

    The old ASP.NET WebForms ReportViewer is obsolete as of Q3 2015 and it will not be further developed. The old web viewer is not suitable for modern browsers due the usage of Table and Iframe elements in its structure.
    In regards to your question, please update the report's assembly qualified name with consideration of the characters case and the following syntax:
    <namespace>.<report_class>, <assembly_name>
    You can also use:
    typeReportSource.TypeName = typeof(QuiCx.Web.Pages.Demos.KendoReporting.CrossTab).AssemblyQualifiedName;
    Where the report's project must be referenced by the web application.


    On a side note, please avoid naming reports with names of reporting items to avoid ambiguity.


    Let us know if you need further help.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. David
    David avatar
    19 posts
    Member since:
    Feb 2015

    Posted 27 Jul Link to this post

    I figured it out once I started playing around with the HTML 5 viewer.

    Other than the UI issues, are there any differences between the 2? 

  5. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 28 Jul Link to this post

    Hello David,

    I can list only part of the features coming to my mind.

    The old ASP.NET WebForms Report Viewer:
    • Is a standard ASP.NET WebForms server-side control operating in the current application;
    • Uses the ASP.NET Session to preserve report resources between requests - Design Considerations for Out-proc Session State. Processed reports are kept in memory and reused on export;;
    • Uses different cache mechanism;
    • Does not have exposed server-side API;
    • Has limited Client-side API and styling options;
    • Uses IFRAME and TABLE elements in its HTML structure - not suitable for modern browsers;
    • Uses an AXD handler to get content from the server;

    The HTML5 Viewer:
    • Is a client-side widget - HTML/CSS/JS, including some Telerik Kendo UI widgets in its toolbar, which can be replaced, if needed.
    • Gets content via Ajax requests executed by the Reporting REST service;
    • Stores rendered documents with option for reusing them - Cache Management;
    • Works with the latest data on the server;
    • Is designed with consideration of modern and mobile browsers;
    • Can reside in a separate project than the Reporting REST service;
    • Can be included in any web application. Existing MVC and WebForms wrappers ease the usage in the corresponding types of projects;
    • Great customization and styling options;
    • Has its API expose;
    • Uses a Reporting REST service which methods can be overridden and extended.
    • Can be used with a Report Server instance.


    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top