MTReiser-3080 avatar image
0 Votes"
MTReiser-3080 asked TReiser-1122 commented

SSRS/ASP.NET using ReportExecution2005 Reference. Setting all required report input parameters but still getting : One or more parameters required to run the report have not been specified.

Although this has been asked before, none of the answers provided solve my issue. I AM passing in all of the required report parameters and all have HasValidValue set in the State property of the parameter array of ExecutionInfo. I am using ReportExecution2005.asmx in my ASP.NET web application. There is no GetParameters() call method to ReportExecution2005.ReportExecutionService object.

My report is calling a subreport so the input parameters are identical to the main report and the subreport. There are 4 single value inputs (two integer, two text) and then one Multivalue text input parameter which I supply multiple values for. I have double and tripled checked that the values I'm setting in the Multivalue input parameter match exactly one of the default parameters.

Here is the code that setups up the reports and renders/writes it out to a PDF file:

 protected void btnPrintReq_Tests_Click(object sender, EventArgs e)
             string query = string.Format("SELECT PatientFName, PatientLName, Address1 + ' ' + Address2 AS Address, City, Region AS State, PostalCode, Email, Phone, Gender, DOB, CONVERT(VARCHAR, ClinicID) AS ClinicID FROM Tbl_ShippingDropShip WHERE RequestID = {0}", giRequestID.ToString());
             string sClinicID = string.Empty;
                 //get the drop ship test order details
                 SqlDataReader reader = default(SqlDataReader);
                 reader = o_cSQL.RunSQLReturnDataReader(query);
                 REService.ReportExecutionService rs_ext = new REService.ReportExecutionService();
                 rs_ext.Credentials = System.Net.CredentialCache.DefaultCredentials;
                 rs_ext.Url = ConfigurationManager.AppSettings["ReportExecutionServer"];
                 List<string> ordereditems = new List<string> { };
                 ordereditems = GetOrderedItems(); //panels and profiles
                 int numordereditems = ordereditems.Count;
                 List<String> comments = new List<String>();
                 if (cbIce.Checked)
                 if (cbKit.Checked)
                 if (cbSwabs.Checked)
                 if (cbGoldTop.Checked)
                     comments.Add("Gold Top");
                 if (cbNeedlePack.Checked)
                     comments.Add("Needle Pack");
                 if (cbButterflyPack.Checked)
                     comments.Add("Butterfly Pack");
                 if (comments.Count == 0)
                 byte[] result = null;
                 string historyID = null;
                 string devInfo = null;
                 string encoding;
                 string mimeType;
                 string extension;
                 REService.Warning[] warnings = null;
                 string[] streamIDs = null;
                 //define the size of the parameter array to pass into the REService
                 REService.ParameterValue[] rValues = new REService.ParameterValue[4 + numordereditems];
                 while (reader.Read())
                     sClinicID = reader["ClinicID"].ToString();
                     rValues[0] = new REService.ParameterValue();
                     rValues[0].Name = "ClinicID";
                     rValues[0].Value = sClinicID;
                     rValues[1] = new REService.ParameterValue();
                     rValues[1].Name = "ReqFormID";
                     rValues[1].Value = giRequestID.ToString();
                     rValues[2] = new REService.ParameterValue();
                     rValues[2].Name = "DropShipID";
                     rValues[2].Value = giDropShipID.ToString();
                     rValues[3] = new REService.ParameterValue();
                     rValues[3].Name = "Comments";
                     rValues[3].Value = string.Join(",",comments.ToArray());
                     int j = 0;
                     for (int  i = 4; i < rValues.Length;  i++)
                         rValues[i] = new REService.ParameterValue();
                         rValues[i].Name = "PanelsNProfiles";
                         rValues[i].Label = "Panels and Profiles :";
                         rValues[i].Value = ordereditems[j++];
                 REService.ExecutionInfo res_info = new REService.ExecutionInfo();
                 res_info = rs_ext.LoadReport("/zReportSandbox/RequisitionDS", historyID);
                 res_info = rs_ext.SetExecutionParameters(rValues, "en-us");
                 res_info = rs_ext.GetExecutionInfo();
                 result = rs_ext.Render("PDF", devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
                 string pdfFile = "Requisition_" + giRequestID.ToString() + "_"+ txtPatientName_Edit.Text + ".pdf";
                 string sPDFSavePath = ConfigurationManager.AppSettings["Shipping_Requisitions"] + sClinicID;
                 //add the date pathing
                 sPDFSavePath = ReportHelper.CreateDateDirectories(sPDFSavePath);
                 //make sure the file doesn't already exist and if it does, delete it so we create a new one
                 ReportHelper.checkPDFfilesNDirectory(sPDFSavePath +@"\", pdfFile);
                 FileStream stream = File.Create(sPDFSavePath + @"\" + pdfFile, result.Length);
                 stream.Write(result, 0, result.Length);
             catch(Exception ex)
                 Common.CommonUtilities.FatalError(sPageName, "btnPrintReq_Tests_Click", query, ex.Message.ToString(), ex.ToString());

I have noticed that the ExecutionInfo item shows me all parameters in the array of the report, meaning the required INPUT parameters AND the INTERNAL parameters, but also noticed that for the INTERNAL parameters, the default value that was set in the report is satisfied and ExecutionInfo shows them with the State of HasValidValue.

The following list is what I know
1) the report works on its own, so the Main report that calls the Subreport has no issues creating the PDF
2) there report when run in SSRS does prompt for the 4 input parameters
3) I have tried the removal of the report in SSRS and redeployed it because there were many that suggested this somehow fixes issues like this.

It would be nice if the error would state what parameter it sees as not being satisfied, even if there are more than one, then simply listing the first one before erroring out would help a developer work through the issues.

The attached picture shows the values I'm passing in for the multivalue parameters (PanelsNProfiles). I'm also attaching my RDL files for the main report and the Subreport, but had to add a (.txt) file extension to them to be able to upload them.

Here is the error in the SSRS execution log:

library!ReportServer_0-57!5250!03/23/2022-09:06:27:: i INFO: RenderForNewSession('/zReportSandbox/RequisitionDS')
processing!ReportServer_0-57!5250!03/23/2022-09:06:27:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: One or more parameters required to run the report have not been specified.;
reportrendering!ReportServer_0-57!5250!03/23/2022-09:06:27:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: , Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: One or more parameters were not specified for the subreport, 'RequisitionTopDS', located at: /zReportSandbox/RequisitionTopDS.;
processing!ReportServer_0-57!5250!03/23/2022-09:06:27:: e ERROR: An error has occurred while processing a sub-report. Details: One or more parameters were not specified for the subreport, 'RequisitionTopDS', located at: /zReportSandbox/RequisitionTopDS. Stack trace:
at Microsoft.ReportingServices.OnDemandReportRendering.SubReport.FinalizeErrorMessageAndThrow()
at Microsoft.ReportingServices.OnDemandReportRendering.SubReport.RetrieveSubreport()186090-requisitiondsrdl.txt


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MTReiser-3080,
Maybe the following problem:
This might be happening if you are building the report in Visual Studio and gave the @Name parameter a default value of (null).
Try removing the default value or making sure you @Name parameter has an actual value, even if it's just ''.
Best regards,
Lan Huang

0 Votes 0 ·

Thanks LanHuang, but I've already done that too. I have removed my Multivalue parameter and made a dataset within the report to get me those values and now the report runs. I would still like to know if anyone has been successful in passing in values in the parameter array for a multivalue parameter that is amongst single value parameters.

0 Votes 0 ·

0 Answers