VB.NET error : specified cast is not valid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Omavlana

    VB.NET error : specified cast is not valid

    Hi, I am getting the above error "specified cast is not valid" while
    sending the parameter to crystal report through VB.NET.

    Here is my code..

    '***********

    Dim paramFields As New ParameterFields
    Dim paramField As New ParameterField
    Dim discreteVal As New ParameterDiscre teValue


    paramField.Para meterFieldName = "Batch Number"

    ' Set the first discrete value and pass it to the parameter
    discreteVal.Val ue = "123"

    paramField.Curr entValues.Add(d iscreteVal)

    paramFields.Add (paramField)

    ' Set the parameter fields collection into the viewer control.
    CrystalReportVi ewer1.Parameter FieldInfo = paramFields


    CrystalReportVi ewer1.ReportSou rce = "C:\TEMP\RpOute rJoin.rpt"

    '***********

    When tested in debug mode,

    "paramField.Par ameterFieldName " didn't get value "Batch Number"

    It has shown,
    <error: an exception of type: {System.Argumen tException} occured>



    Pls help...

    Regards,
    Omav
Working...