none
Unable to display string "NA" in rdlc report text box whose Field is of type System.string if the Datetime in null RRS feed

  • Question

  • Hi,

    I need to display a string value "NA" in the text box of an rdlc report if the DateTime retrieved from the Database is null.

    If the DateTime is not null then it has to diaply the datetime.These values should be displayed in the Main Report from a subreport.

    Following is the expression that I used

    =IIF((First(Fields!DateTransOrRec.Value, "DocumentsRelatedData")= "NA"),"NA",CDate(First(Fields!DateTransOrRec.Value, "DocumentsRelatedData")).ToString("dd/MMM/yyyy"))

    I am getting the value if there is a value for Datetime.

    If the value retieved by the database is "NA", it is failing to display "NA" instaed it is displaying "#Error"

     

    Friday, October 28, 2011 3:43 AM