We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I programmatically override parameters for the JavaScript ReportViewer on the server?

Thread ID:

Created:

Updated:

Platform:

Replies:

118435 Mar 9,2015 06:10 AM UTC Apr 14,2015 04:42 AM UTC JavaScript 3
loading
Tags: ejReportViewer
Waldemar Sauer
Asked On March 9, 2015 06:10 AM UTC

I have a report that are available to multiple customers for data in their company. As such, the report takes a tenant Id. Needless to say, I do not want customers to be able to see the report for any data other than for their company. To do this, the report takes a tenant Id that is stored in a server session variable.

How do I pass a tenant Id to the report viewer (JavaScript) without the user being able to override it?

I tried overriding the API Controller's OnReportLoaded as follows:
public void OnReportLoaded(ReportViewerOptions reportOptions)
{
            reportOptions.ReportModel.Parameters = new List<ReportParameter> {
                new ReportParameter {
                    Name = "TenantId",
                    Values = new List<string> {"1000"},
                }
            };
        }

This only works if the parameter is visible, which means that the user is able to override the parameter value.

-Waldemar


Vignesh Tamil Selvan [Syncfusion]
Replied On March 10, 2015 06:23 AM UTC

Hi Waldemar,

Thanks for using Syncfusion products.

                    Query

                                Response

How do I pass a tenant Id to the report viewer (JavaScript) without the user being able to override it?

I tried overriding the API Controller's OnReportLoaded as follows:

                        public void OnReportLoaded(ReportViewerOptions reportOptions)

                        {

            reportOptions.ReportModel.Parameters = new List<ReportParameter> {

                new ReportParameter {

                    Name = "TenantId",

                    Values = new List<string> {"1000"},

                }

            };

        }

ReportViewer has support to set parameters in either  JavaScript and API Controller’s overloads.

Please refer our online document for more details.

http://help.syncfusion.com/ug/js/documents/reportparameters.htm

This only works if the parameter is visible, which means that the user is able to override the parameter value.

This is a known bug and we request you to create a Support Ticket in our DirectTrack support system to get a solution or more details about this bug.

Please log into DirectTrac support system to create a new support ticket.

Please let us know if you have any questions.

Regards,

Vignesh T



Waldemar Sauer
Replied On April 13, 2015 10:10 PM UTC

The hidden parameters feature is now working nicely in Essential Studio 2015 Volume 1.

Thank you,
-Waldemar


Soundara Rajan S [Syncfusion]
Replied On April 14, 2015 04:42 AM UTC

Hi Waldemar,

Thanks for your update. Please let us know, if you need any further assistance on this?.

Regards,
Soundara Rajan S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;