vineri, 22 aprilie 2016

Display formatted date if exists in SSRS report, or nothing

    First, of all, i set Allow Blank true and Nullable true for my parameters. In case the user chooses to avoid providing them, just display all the lines, without ranges. 

I am not going to post all the code from my report, but at some point in the processReport phase i set the dates range as :

 
     if (fromDate && toDate)
    {
        qbr = qbdsCT.addRange(fieldNum(CustTrans, TransDate));
        qbr.value(queryRange(fromDate, toDate));
    }


where qbdsCT is my QueryBuildDataSource object.



And finally in the SSRS i use this :

 =IIF(Parameters!CustTrans_DS_FromDate.Value is nothing, nothing,         FormatDateTime(Parameters!CustTrans_DS_FromDate.Value, 2))

Niciun comentariu:

Trimiteți un comentariu