Question : call .rdl with store procedure with parameter

I have a report (Reporting Services) whose data source the following procedure
CREATE procedure [certifica].[ObtenerDiscentesParaArchivo]
   @CodigoActividad numeric (38,0)

I am using the render method of reporting services web service, but do not know how to pass the parameter, can you help?
this is the code
    Protected Sub btnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGuardar.Click
        Dim archivo As String = "C:\Users\elopez\Documents\AMAG\_SGC\pdfGenerado\certificado.pdf"
        Dim formato As String = "PDF"
        Dim history As String = Nothing
        Dim rsGuardar As ReportExecutionService = New ReportExecutionService()

        rsGuardar.Credentials = System.Net.CredentialCache.DefaultCredentials
        rsGuardar.LoadReport(Me.ReportViewer1.ServerReport.ReportPath, history)

        Dim deviceInfo As String = [String].Empty
        Dim extension As String = formato
        Dim resultado As [Byte]() = Nothing
        Dim codificacion As String = [String].Empty
        Dim mimeType As String = [String].Empty
        Dim warnings As amagCertifica.rsExecution2005.Warning = Nothing
        Dim streamsIds As String() = Nothing
        resultado = rsGuardar.Render(formato, deviceInfo, extension, codificacion, mimeType, Nothing, streamsIds)

        Using streams As FileStream = File.OpenWrite(archivo)
            streams.Write(resultado, 0, resultado.Length)
        End Using
    End Sub

This is error
This report requires a default or user-defined for the report parameter 'CodigoActividad'. To run this report or subscribe to it, you must provide a parameter value. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ReportParameterValueNotSetException: This report requires a default or user-defined for the report parameter 'CodigoActividad'. To run this report or subscribe to it, you must provide a parameter value.


Sugiere una traducción mejor
Gracias por proponer una traducción al Traductor de Google.
Sugiere una traducción mejor:This report requires a default or user-defined for the report parameter 'CodigoActividad'. To run this report or subscribe to it, you must provide a parameter value. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ReportParameterValueNotSetException: This report requires a default or user-defined for the report parameter 'CodigoActividad'. To run this report or subscribe to it, you must provide a parameter value.

In this line
resultado = rsGuardar.Render(formato, deviceInfo, extension, codificacion, mimeType, Nothing, streamsIds)

Answer : call .rdl with store procedure with parameter

We using this type of format for PDF 2008.

Imports SQL2008


Protected Sub btnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGuardar.Click
        Dim rs As New ReportExecutionService()
       rs.Credentials = System.Net.CredentialCache.DefaultCredentials
       rs.Url = System.Configuration.ConfigurationManager.AppSettings("sql2008.ReportExecution2005")
        Dim archivo As String = "C:\Users\elopez\Documents\AMAG\_SGC\pdfGenerado\certificado.pdf"
       Dim formato As String = "PDF"
       Dim history As String = Nothing
        ' Render arguments
       Dim resultado As Byte() = Nothing
       Dim reportPath As String = "/ServerReports/" & ReportName
       Dim format As String = "PDF"
       Dim historyID As String = Nothing
       Dim devInfo As String = "<DeviceInfo><StreamRoot>/RSWebServiceXS/</StreamRoot></DeviceInfo>"
        Dim encoding As String = Nothing
       Dim mimeType As String = Nothing
       Dim warnings As SQL2008.Warning() = Nothing
       Dim streamIDs As String() = Nothing
        Dim execInfo As New ExecutionInfo
       Dim execHeader As New ExecutionHeader
       Dim extension As String = ""
        resultado = rs.Render(formato, devInfo, extension, mimeType, encoding, warnings, streamIDs)
        Response.ClearContent()
       Response.ContentType = "application/pdf"
       Response.BinaryWrite(resultado)
       Response.Flush()
   End Sub
 

Random Solutions  
 
programming4us programming4us