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

hide parameters and block changes

3 Answers 165 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arthur
Top achievements
Rank 1
Arthur asked on 13 Mar 2012, 08:29 PM
I'm using MVC 3, and I use Telerik Report to call a method witch the parameter is the user id, and it should not be changed, so the user wouldn't see other user data.

public List<ViewBoleto> ListBoleto(long userid)

what I did was, in the report.cs, I let the parameter as:
 new Telerik.Reporting.ObjectDataSourceParameter("userid", typeof(long), "=Parameters.userid.Value")});

so I set the value in ViewReport.aspx, and I set as Visible = false, so nobody could edit it.

rpt.ReportParameters["userid"].Value = ViewData["UserId"];
rpt.ReportParameters["userid"].Visible = false;

It works wonders, but there is a bug, when I click in Refresh, the "Navigate Back" button turns green, and if I click on it, the Parameters will turn to Visible = true, and the user can change the values!!!

Is there a better way to I call the method ListBoleto, and pass the parameter, and block the user from changing it?

3 Answers, 1 is accepted

Sort by
0
Arthur
Top achievements
Rank 1
answered on 15 Mar 2012, 03:43 PM
here is a sample:
mirror1: http://www.mediafire.com/?pzmv7o48bb75err
mirror2: http://www.crocko.com/DC177BE8D9AD498B9581512C7ACD22AC/TelerikReportTest.zip

I tried in the Telerik Reporting Q1 2012

in the TelerikReportTest folder there are 3 pictures that shows what is happening.

In the sample, there are 2 users (user 1, and user 2). When the bug happens, I can access the other user.
0
Steve
Telerik team
answered on 16 Mar 2012, 03:39 PM
Hi Arthur,

We've answered your inquiry in the support ticket you've opened. Here is our reply:

We verified the unexpected behavior you've reported. For the time being you can easily resolve this by setting the ParametersAreaVisible property of the viewer to false.

Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Arthur
Top achievements
Rank 1
answered on 16 Mar 2012, 05:25 PM
Hi Steve,

I tried to set it to false in the Report1.Designer.cs file before, but I had somewhat misunderstood it, and couldn't make it work. But I got it now, and it's working great!

Thank you very much :)
Tags
General Discussions
Asked by
Arthur
Top achievements
Rank 1
Answers by
Arthur
Top achievements
Rank 1
Steve
Telerik team
Share this question
or