Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:13:50+00:00 2026-05-25T16:13:50+00:00

I’m trying to get the parameter of user name and replace its value with

  • 0

I’m trying to get the parameter of user name and replace its value with the session’s username so I can pass to a Stored procedure inside the DRL to generate a table timestamp with this user name.
The parameter “username” is one of the parameters of the RDL which comes with default value and I’m trying to change it with the following code.

Replacing one of the ReportParameters:

var userParameter = GetUserParameter();
if (userParameter != null)
{
    newParameters.Remove(newParameters.FirstOrDefault(param => param.Name.Contains(CurrentUserParameterName)));
    newParameters.Add(userParameter);
}

Finding username ReportParameters:

var paremeters = ReportViewer.ServerReport.GetEditableHiddenParameters();

//finds parameter by its name, pelase view const value in CurrentUserParameterName
var userParameter = paremeters.FirstOrDefault(param => param.Name.Contains(CurrentUserParameterName));
if (userParameter != null)
{
    userParameter.Values.Clear();
    userParameter.Values.Add(Utils.GetUserName());
}
return userParameter;

Set Parameters to ServerReport:

ReportViewer.ServerReport.SetParameters(parameters);

After running the report, I get the message “The ‘username’ parameter is missing a value”

When I debug and look in the ServerReport.GetParameters() I can see that I do have the ReportParameter “username”, I do have values (the new values), but its State is “MissingValidValue”.

What am I doing wrong?
Thanks in advance,
Eddie

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:13:51+00:00Added an answer on May 25, 2026 at 4:13 pm

    I’ve finally managed to fix this issue thanks to this article: http://technet.microsoft.com/en-us/library/dd220464.aspx

    If you have specified available values for a parameter, the valid
    values always appear as a drop-down list. For example, if you provide
    available values for a DateTime parameter, a drop-down list for dates
    appears in the parameter pane instead of a calendar control. To ensure
    that a list of values is consistent among a report and subreports, you
    can set an option on the data source to use a single transaction for
    all queries in the datasets that are associated with a data source.

    Since I entered a default value in the “available values” option in addition to putting it in the “default values”, the report tried to validate the new session username, which wasn’t listed as an “available value”. Once I removed the values in “available values”, the new ReportParameter that I supply in code-behind didn’t have to be validated, and the report rendered successfully.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.