none
Parametros... RRS feed

  • Pergunta

  •         Dim daCesta As New OleDbDataAdapter("Select * from Cestas Where Cestas.Codcesta = " & CInt(numCES_ID.Text), conn)
           
    Dim daItens As New OleDbDataAdapter("Select * from ItemCes Where ItemCes.CODCESTA = " & CInt(numCES_ID.Text), conn)
           
    Dim daProdutos As New OleDbDataAdapter("Select * from Produto p, [ItemCes] it Where p.ID_PRO = it.CODPRODU and it.CODCESTA = " & CInt(numCES_ID.Text), conn)
           
    Dim dsRelatorio As New dsCotacao
            conn
    .Open()
            daCesta
    .Fill(dsRelatorio.CESTAS)
            daItens
    .Fill(dsRelatorio.ITEMCES)
            daProdutos
    .Fill(dsRelatorio.PRODUTO)
            conn
    .Close()
           
    Dim relatorio As New crCotacao
           
    Dim crParameterDiscreteValue As ParameterDiscreteValue
           
    Dim crParameterFieldDefinitions As ParameterFieldDefinitions
           
    Dim crParameterFieldLocation As ParameterFieldDefinition
           
    Dim crParameterValues As ParameterValues
            relatorio
    .SetDataSource(dsRelatorio)
            crParameterFieldDefinitions
    = relatorio.DataDefinition.ParameterFields
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("qtdcestas")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = numQuantid.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("prunit")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
           crParameterDiscreteValue
    .Value = numUnitario.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("entrega")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtEntrega.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("prazpgt")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtPrazo.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("validade")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtValidade.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("desconto")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = numDesconto.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("Razao")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtRazaoSoc.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("Ender")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
             crParameterDiscreteValue
    .Value = txtEndereco.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("CEP")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtCodPostal.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("Cidade")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtCidade.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("Estado")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtEstado.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    = crParameterFieldDefinitions.Item("Contato")
            crParameterValues
    = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue
    = New CrystalDecisions.Shared.ParameterDiscreteValue
            crParameterDiscreteValue
    .Value = txtContato.Text
            crParameterValues
    .Add(crParameterDiscreteValue)
            crParameterFieldLocation
    .ApplyCurrentValues(crParameterValues)
           
    Try
               
    Dim CrExportOptions As ExportOptions
               
    Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()
               
    Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
               
    CrDiskFileDestinationOptions.DiskFileName = "X:\crystalExport.pdf"
               
    CrExportOptions = relatorio.ExportOptions
               
    With CrExportOptions
                   
    .ExportDestinationType = ExportDestinationType.DiskFile
                   
    .ExportFormatType = ExportFormatType.PortableDocFormat
                   
    .DestinationOptions = CrDiskFileDestinationOptions
                   
    .FormatOptions = CrFormatTypeOptions
               
    End With
                relatorio
    .Export()
           
    Catch ex As Exception
               
    MsgBox(ex.ToString)  'AQUI dá o erro!!!!
        
       End Try
        End Sub

    Estou recebendo um erro que que estao faltando paramentros na rotina acima... mas são doze e ja conferi varias vezes... o que estou fazendo de errado?

    Alguem poderia me ajudar?

    Obrigado


    Luiz Melo

    segunda-feira, 26 de março de 2012 18:33

Todas as Respostas