简体   繁体   中英

Sql Server Reporting Services Webservice Exception on processing Parameter, preview in vs2015 works, call on report server works

the error may have been caused by upgrading a VS 2013 solution to VS 2015. During Migration the Report-Project could not be migrated so I had to add a new one and set Compatibility to "Sql Server 2008". According to another thread i deployed the .rdl File in the Debug-Folder to our ReportServer because the SourceFile still Points to 2016.

During preview the Parameter is selected via a Combobox, where the user the selects a string an an id is provided as Reportparameter.

ReportExecutionService.Render throws the Exception:

" Error during processing of 'paraDepot' Report Parameter. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: "Error during processing of 'paraDepot' Report Parameter.

<ReportParameters>
<ReportParameter Name="paraDepot">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>DepotNames</DataSetName>
<ValueField>ID_DEPOT</ValueField>
</DataSetReference>
</DefaultValue>
<Prompt>Depot</Prompt>
<ValidValues><DataSetReference>
<DataSetName>DepotNames</DataSetName>
<ValueField>ID_DEPOT</ValueField>
<LabelField>DEPOT</LabelField>
</DataSetReference></ValidValues>
</ReportParameter>
...
</ReportParameters>

The Report has got only some additional fields but it it the same as the one deployed from a Windows7 Environment from vs 2013. So I copied the Report into another File lets say ReportV2015.rdl.

If I take a report-Path to the Report-File deployed form Windows7, lets call it ReportV2013.rdl than the Render method works.

So could this behaviour be caused by an unlucky combnination of Version of installed libraries? Is the Version of SSDT (SQL Server Data Tools) important?

Also VS2015 and VS2013 runs on different Virtual Machines. So, for which Libraries I would had to check the Versions?

The ReportService calls: ReportServer/Reportexecution2005.asmx. The Render Method uses the DevInfo Parameter: @"False"

Any ideas are appreciated. Actually I fear to have to downgrade to vs2013 again and Remake the Upgrades in the Reportfile as I spent already about 2 days with any result.

So this is how the Report is called from Application:

ReportExecutionService loReportingService = new ReportExecutionService();
loReportingService.Url = "http://10.20.30.40/ReportServer/Reportexecution2005.asmx"; // (IP changed)
loReportingService.Credentials = new System.Net.NetworkCredential( ltReportuser, ltReportPassword, ltReportDomain );

string ltDevInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

// Setting the Parameters:
ParameterValue loDepot = new ParameterValue();
                loDepot.Name = "paraDepot";
                loDepot.Value = poShift.ID_DEPOT.ToString();
// ... ParameterValue loShiftType ...           

ParameterValue loShiftDate = new ParameterValue();
loShiftDate.Name = "paraDate";
// loShiftDate.Value = poShift.DATE.ToString( "dd/MM/yyyy" ); // seems to make no difference
loShiftDate.Value = poShift.DATE.ToString("dd.MM.yyyy");

ParameterValue[] laReportingServiceParameter = { loDepot, loShiftType, loShiftDate };

string ltHistoryID = null; // ltReportPath is just the Path to the .rdl File
loReportingService.ExecutionHeaderValue = new ExecutionHeader();
//Load the Report
var execInfo = loReportingService.LoadReport( ltReportPath, ltHistoryID );
//Set Parameters for Report
execInfo = loReportingService.SetExecutionParameters( laReportingServiceParameter, "de-DE" );

// Instruction which throws the Exception:
result = loReportingService.Render( "PDF", ltDevInfo, out ltExtension, out ltEncoding, out ltMimeType, out laWarnings, out laStreamIDs );

Some Details to the SoapException:

<ErrorCode xmlns="http://www.microsoft.com/sql/reportingservices">
rsReportParameterProcessingError
</ErrorCode>
<HttpStatus xmlns="http://www.microsoft.com/sql/reportingservices">
400
</HttpStatus>
<Message xmlns="http://www.microsoft.com/sql/reportingservices">
Error during processing of ‘paraDepot’ report parameter.
</Message>
<HelpLink xmlns="http://www.microsoft.com/sql/reportingservices">
http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsReportParameterProcessingError&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.5058.0
</HelpLink>
<ProductName xmlns="http://www.microsoft.com/sql/reportingservices">
Microsoft SQL Server Reporting Services
</ProductName>
<ProductVersion xmlns="http://www.microsoft.com/sql/reportingservices">11.0.5058.0</ProductVersion>
<ProductLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId>
<OperatingSystem xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem>
<CountryLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId>
<MoreInformation xmlns="http://www.microsoft.com/sql/reportingservices"><Source>Microsoft.ReportingServices.ProcessingCore</Source>
<Message msrs:ErrorCode="rsReportParameterProcessingError" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsReportParameterProcessingError&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.5058.0" xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Error during processing of ‘paraDepot’ report parameter.</Message>
</MoreInformation>
<Warnings xmlns="http://www.microsoft.com/sql/reportingservices"/>

Best Regards

 protected ParameterValue[] ReportPrameters;

   private void GetPDFByteStreamFromService()
            {
                var execHeader = new ExecutionHeader();
                var deviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

                var reportService = new ReportExecutionService()
                {
                    Credentials = CredentialCache.DefaultCredentials,
                    Url = ConfigurationManager.AppSettings.Get("ServiceURL"),
                    Timeout = System.Threading.Timeout.Infinite
                };

                reportService.ExecutionHeaderValue = execHeader;
                reportService.LoadReport(ReportPathInSSRS(), null);

                SetReportParameter();

                reportService.SetExecutionParameters(ReportPrameters, "en-us");

                try
                {
                    const string reportFormat = "PDF";

                    CurrentStatement.StatementsPDFBytes = reportService.Render(reportFormat, deviceInfo, out string extension, out string mimeType,
                        out string encoding, out Warning[] warnings, out string[] streamIDs);
                }
                catch (SoapException ex)
                {
                    Log.Error($"GetPDFByteStreamFromService SoapExcetpion: {ex.Message}", ex);
                    throw new Exception($"Error generating PDF Report");
                }
            }

public virtual void SetReportParameter()
        {

            ReportPrameters = new ParameterValue[3];
            ReportPrameters[0] = new ParameterValue()
            {
                Name = "Param1",
                Value = "1"
            };

            ReportPrameters[1] = new ParameterValue()
            {
                Name = "Param2",
                Value = "false"
            };

            ReportPrameters[2] = new ParameterValue()
            {
                Name = "Code",
                Value = "XYZ"
            };

            return;
        }

Ok, I finally dared it. I renamed the new Report to old File Name and I have overwritten the original one. The Dataset-Connections stored on Server have remained and now it works.

Now the original Problem is solved but I would like to know why I cannot store the DataSource Connection on the new uploaded File.

I get sth. like in

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4433567b-76d4-4864-b444-f57edf7efb14/rsaccessdenied-sql-server-2012-reporting-services?forum=sqlreportingservices

If I would have to upload once a 2nd Report I will be lost then. For now I can live with this and hope that noone destroys accidently the Settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM