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 7728393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:42:21+00:00 2026-06-01T05:42:21+00:00

I’m generating a reporting services report from an ASP.NET (MVC) based application but am

  • 0

I’m generating a reporting services report from an ASP.NET (MVC) based application but am having problems setting the parameters for the report.

I believe the issue has only occurred since we upgraded SQL Server from 2005 to 2008 R2 (and Reporting Services along with it).

The original error encountered was from calling rsExec.Render:

Procedure or function ‘pCommunication_ReturnRegistrationLetterDetails’
expects parameter ‘@guid’, which was not supplied.

Debugging the code I noticed that rsExec.SetExecutionParameters is returning the following response:

Cannot call ‘NameOfApp.SQLRSExec.ReportExecutionService.SetExecutionParameters(NameOfApp.SQLRSExec.ParameterValue[],
string)’ because it is a web method.

Here is the function in it’s entirety:

public static bool ProduceReportToFile(string reportname, string filename, string[,] reportparams, 
    string fileformat)
{
    bool successful = false;
    SQLRS.ReportingService2005 rs = new SQLRS.ReportingService2005();
    SQLRSExec.ReportExecutionService rsExec = new NameOfApp.SQLRSExec.ReportExecutionService();

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
    rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;

    // Prepare Render arguments
    string historyID = null;
    string deviceInfo = null;

    // Prepare format - available options are "PDF","Word","CSV","TIFF","XML","EXCEL" 
    string format = fileformat;

    Byte[] results;
    string encoding = String.Empty;
    string mimeType = String.Empty;
    string extension = String.Empty;

    SQLRSExec.Warning[] warnings = null;
    string[] streamIDs = null;

    // Define variables needed for GetParameters() method
    // Get the report name
    string _reportName = reportname;
    string _historyID = null;
    bool _forRendering = false;
    SQLRS.ParameterValue[] _values = null;
    SQLRS.DataSourceCredentials[] _credentials = null;
    SQLRS.ReportParameter[] _parameters = null;

    // Get if any parameters needed.
    _parameters = rs.GetReportParameters(_reportName, _historyID,
                    _forRendering, _values, _credentials);

    // Load the selected report.
    SQLRSExec.ExecutionInfo ei =
            rsExec.LoadReport(_reportName, historyID);

    // Prepare report parameter.
    // Set the parameters for the report needed.
    SQLRSExec.ParameterValue[] parameters =
            new SQLRSExec.ParameterValue[1];

    // Place to include the parameter.
    if (_parameters.Length > 0)
    {
        for (int i = 0; i < _parameters.Length; i++)
        {
            parameters[i] = new SQLRSExec.ParameterValue();
            parameters[i].Label = reportparams[i,0];
            parameters[i].Name = reportparams[i, 0];
            parameters[i].Value = reportparams[i, 1];
        }
    }
    rsExec.SetExecutionParameters(parameters, "en-us");
    results = rsExec.Render(format, deviceInfo,
                out extension, out encoding,
                out mimeType, out warnings, out streamIDs);

    // Create a file stream and write the report to it
    using (FileStream stream = System.IO.File.OpenWrite(filename))
    {
        stream.Write(results, 0, results.Length);
    }
    successful = true;

    return successful;
}

Any ideas why I’m now unable to set parameters? The report generation works without issue if parameters aren’t required.

  • 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-06-01T05:42:22+00:00Added an answer on June 1, 2026 at 5:42 am

    Looks like it may have been an issue with how reporting services passes parameters through to the stored procedure providing the data. A string guid was being passed through to the report and the stored procedure expected a varchar guid. I suspect reporting services may have been noticing the string followed the guid format pattern and so passed it through as a uniqueidentifier to the stored procedure.

    I changed the data source for the report from “stored procedure” to “text” and set the SQL as “EXEC pMyStoredOProcName @guid”.

    Please note the guid being passed in as a string to the stored procedure is probably not best practice… I was simply debugging an issue with another developers code.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

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.