Duplicated
Last Updated: 15 Oct 2024 10:34 by ADMIN
Cesar
Created on: 08 Oct 2024 14:03
Type: Feature Request
0
Hide parameters area for Blazor Native Report Viewer


                <Telerik.ReportViewer.BlazorNative.ReportViewer
                    @ref="reportViewer"
                    ServiceType="ReportViewerServiceType.REST"
                    PageMode="PageMode.SinglePage"
                    ServiceUrl="@(ServiceUrl)"
                    @bind-ReportSource="@ReportSource"
                    AuthenticationToken="@(AuthToken)"
                    ScaleMode="(ScaleMode)ReportSetItem.Report.ScaleMode"
                    @bind-ParametersAreaVisible="@ParametersAreaVisible"
                    Scale="1.5">
                </Telerik.ReportViewer.BlazorNative.ReportViewer>

The variable, ParametersAreaVisible, is set to false. The report viewer is still showing the parameters area. I went back to the designer and set all parameters to Visible = false. When I did this, the parameters area is not displayed.

The report viewer should respect what is bound to ParametersAreaVisible.

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 15 Oct 2024 10:34

Hi, Cesar,

The ParametersAreaVisible determines whether the Native Blazor Report Viewer's parameters area is displayed if any parameter editor exists. It is weird behavior if the value is set to false and you are still viewing the parameters area. 

It seems that we already have a known issue related to the ParametersAreaVisible property and values set during the initialization of the viewer are not respected. You can cast your vote for the item, track its progress, subscribe for status changes, and add your comments on the following link: 

The DocumentMapVisible/ParametersAreaVisible values set during the initialization of the viewer are not respected

Please give the suggested workaround in the public item a try and see how it works on your end.

Another approach is to use the OnRenderingBegin event of the Native Blazor Report Viewer component to dynamically change the parameters area visibility, for example: 

<ReportViewer @ref=rv1 ServiceUrl="/api/reports"
    @bind-ReportSource="@ReportSource"
    @bind-ParametersAreaVisible="@ParametersAreaVisible"
    PageMode="@PageMode.ContinuousScroll"
    OnRenderingBegin="@RenderingBegin"
    ServiceType="@ReportViewerServiceType.REST"
    Height="800px"
    Width="100%">
</ReportViewer>
@code {
    public bool ParametersAreaVisible { get; set; }
    ReportViewer rv1 { get; set; }
    public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Dashboard.trdp", new Dictionary<string, object>
    { });
  
  void RenderingBegin(RenderingBeginEventArgs args)
    {
        this.ParametersAreaVisible = ...;
    }
}
For more information on how to use the report viewer events, you may refer to the Native Blazor Report Viewer Events - Telerik Reporting article.

Alternatively, the OnAfterRender Blazor component lifecycle event can also be used for the task: 
 protected override void OnAfterRender(bool firstRender)
    {
        this.ParametersAreaVisible = ...;
        base.OnAfterRender(firstRender);
    }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.