This is a migrated thread and some comments may be shown as answers.

Parameter area not visible in report viewer

4 Answers 704 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Iron
Bob asked on 26 Nov 2018, 04:34 PM

I am trying to upgrade a visual studio 2015 mvc application from R3 2016 to R3 2018.  The upgrade wizard reported that it successfully upgraded the solution, but it didn't.  I manually added the new libraries and fixed the reportviewer code and api code.  Unfortunately I cannot get the parameter area to show for any reports.  My project contains the following references:

Telerik.Reporting.dll (12.2.18.1017)

Telerik.Reporting.Services.WebApi (12.2.18.1017)

Telerik.ReportViewer.Mvc (12.2.18.1017)

The code for the view is as follows - note that I tried explicitly setting the parameter area visible in the code and I also have clicked the parameter toggle on the toolbar once the report loads - neither had any effect.

@model MTE.MVC.Models.ReportModel
@{
    ViewBag.Title = "Reports";
    MTE.MVC.MTEIdentity currentUser = null;
    if (Request.IsAuthenticated)
    {
        currentUser = (User as TACSecurity.TSPrincipal).Identity as MTE.MVC.MTEIdentity;
    }
}
 
@section styles
{
    @Styles.Render("~/Reports/styles/telerikReportViewer.css")
    <style>
        #reportViewer1 {
            position: relative;
            width: 100%;
            height: 750px;
            font-family: 'segoe ui', 'ms sans serif';
            overflow: hidden;
        }
    </style>
}
 
 
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-12">
            <div class="form-inline">
                <div class="form-group" id="grpCategory">
                    <label class="control-label">Category</label>
                    @(Html.Kendo().DropDownList().Name("cboCategory").HtmlAttributes(new { style = "width:200px" })
                   .DataSource(d => d
                        .Read("GetReportCategories", "Reporting")
                        .Events(events => events.Error("kendoErrorHandler"))
                        )
                    )
                </div>
                <div class="form-group">
                    <label class="control-label">Report</label>
                    @(Html.Kendo().DropDownList().Name("cboReport").HtmlAttributes(new { style = "width:400px" })
                    .DataTextField("ReportName")
                    .DataValueField("ReportUri")
                    .DataSource(d => d
                        .ServerFiltering(true)
                        .Read(read => read.Action("GetReportNames", "Reporting").Data("paramCategory"))
                        .Events(events => events.Error("kendoErrorHandler"))
                        )
                        .CascadeFrom("cboCategory")
                    .AutoBind(false)
                    )
                </div>
                <div class="form-group">
                    <button type="button" class="btn btn-primary" onclick="btnReportClick()">Load</button>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-xs-12">
            @(Html.TelerikReporting().ReportViewer()
                   .Id("reportViewer1")
                   .ServiceUrl("/api/reportsapi/")
                   .ReportSource("Default Report.trdx")
                   .ViewMode(ViewMode.Interactive)
                   .ScaleMode(ScaleMode.Specific)
                   .Scale(1.0)
                   .PersistSession(false)
                    .PrintMode(PrintMode.AutoSelect)
                    .EnableAccessibility(false)
                    .SearchMetadataOnDemand(false)
                    .SendEmail(new SendEmail { Enabled = true })
                   .Deferred()
            )
        </div>
    </div>
</div>
 
@section scripts
{
<script src="@Url.Content("~/Reports/js/telerikReportViewer.kendo-12.2.18.1017.min.js")"></script>
<script src="@Url.Content("~/Reports/js/telerikReportViewer-12.2.18.1017.js")"></script>
    @(Html.TelerikReporting().DeferredScripts())
}
 
<script type="text/javascript">
 
    $(document).ready(function () {
        @if(currentUser.Role == MTE.MVC.Roles.Customer || currentUser.Role == MTE.MVC.Roles.Hauler)
        {
            @:$("#grpCategory").hide();
        }
       // $("#cboReport").data("kendoDropDownList").dataSource.read();
    });
 
 
    function paramCategory() {
        @if(currentUser.Role == MTE.MVC.Roles.Customer)
        {
            @:return { category: "Customers" };
        }
        else if(currentUser.Role == MTE.MVC.Roles.Hauler)
        {
            @:return { category: "Haulers" };
        }
        else
        {
            @:return { category: $("#cboCategory").val() };
        }
    }
 
    function btnReportClick() {
        var category;
        var cboReport = $("#cboReport").data("kendoDropDownList");
        @if(currentUser.Role == MTE.MVC.Roles.Customer)
        {
            @:category = "Customers";
        }
        else if(currentUser.Role == MTE.MVC.Roles.Hauler)
        {
            @:category = "Haulers";
        }
        else
        {
            @:category = $("#cboCategory").val();
        }
        var viewer = $("#reportViewer1").data("telerik_ReportViewer");
        var report = $("#cboReport").val();
        if (report != null && report != "") {
            var reportName = cboReport.dataItem(cboReport.select()).ReportName;
            $.ajax({
                type: "POST",
                url: '@Url.Action("ReportAuditHandler", "Reporting")',
                data: {
                    reportName: reportName
                    }
            });
            viewer.reportSource({
                report: report,
            });
            viewer.refreshReport();
        }
        else {
            alert("No report chosen - please choose a report");
        }
 
    }
 
 
</script>

4 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 29 Nov 2018, 12:56 PM
Hi Bob,

We have faced a similar issue before and it seems that the issue comes from a custom local template for the viewer which is not updated to the latest version. However, from the provided code snippet of the report viewer, I noticed that you are not loading custom viewer template. 

In general, to have visible parameter area you'll have to make sure that at least one report parameter has its Visible property turned on. 

Could you open a new support ticket and send us the the report itself and all project references, e.g. js and css files loaded, so I could build a sample project for local testing? 

Additionally, I could suggest to test our examples that come with the installation of Telerik Reporting. They can be found in Telerik Reporting installation folder e.g. C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Examples\CSharp. Visible parameters area have for example the Invoice, Dashboard and Product Line Sales reports. Then try to compare the settings with the problematic project.

Regards,
Silviya
Progress Telerik
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
0
Bob
Top achievements
Rank 1
Iron
answered on 29 Nov 2018, 02:01 PM
The issue was in the upgrade from R3 2016.  Previously R3 2016 didn't require references to Telerik.Reporting.OpenXmlRendering.dll and Telerik.Reporting.XpsRendering.dll.  When I saw these references in the MVC demo project, I added them to my project and the parameter area was visible.  As stated in my original post, the upgrade wizard didn't work properly even though it stated that it had upgraded the solution successfully.  After running the wizard, the R3 2016 references remained in the project.  In any case, my issue has been solved - thanks.
0
Silviya
Telerik team
answered on 29 Nov 2018, 02:30 PM
Hi Bob,

I'm happy to hear that you've managed to solve the issue.

I just need to note one thing. In general, the Telerik.Reporting.OpenXmlRendering.dll and Telerik.Reporting.XpsRendering.dll are required in order to enable the Telerik Reporting OpenXML rendering extensions (XLSX, DOCX, PPTX and XPS). They have nothing to do with the visibility of the parameters area. 
However, I notice one thing. You said that after running the wizard, the R3 2016 references were still in the project. So, my assumption is that the parameter area was not visible because of an old references in the project. After completing the upgrade process of all JS and CSS files, the viewer is rendered as expected.

Regards,
Silviya
Progress Telerik
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
0
Bob
Top achievements
Rank 1
Iron
answered on 29 Nov 2018, 02:36 PM
Unfortunately, that is not correct.  After running the upgrade wizard, I noticed the references had not been upgraded.  So I manually upgraded them (Telerik.Reporting, Telerik.ReportViewer.Mvc, Telerik.Reporting.Services.WebApi).  At this time, the parameter area was not visible.  I then (today) added the two other references, and the parameter area was visible.  Not sure why, but that's what fixed my issue.
Tags
General Discussions
Asked by
Bob
Top achievements
Rank 1
Iron
Answers by
Silviya
Telerik team
Bob
Top achievements
Rank 1
Iron
Share this question
or