How To Display Side By Side Records in crystal report? RRS feed

  • Question

  • User-872253956 posted

    I have use DataTable to bind my crystal report. my DataTable contains credit & debit amount column,in which when credit amount != 0 then debit amount = 0 and vice versa. means every column contains either credit or debit information.

    i want to display something like the below format.

    Bank Name(Credit)|CreditAmt|BankName(Debit)|DebitAmt

    in my first column i want to display credit records bank name and second column displays Credit Amount and same logic for Debit amount which is displays in 3rd and 4th column.

    currently my output look like below :

    - HDFC Bank | 550 |(blank) | 0 
    - blank) | 0 | 500 | HDFc bank
    here i get blank space and 0 in any section either credit or debit because i only get credit or debit amount per record so it puts 0 and blank space for other section i want to suppress(hide) this blank portion if i achieve this i will get following output of the above list.
    HDFC Bank | 550 |(blank) | 500 |HDFc bank 
    so how do i achieve this?

    Monday, October 15, 2012 12:09 AM


  • User-578610739 posted

    Hi Smsavsani,

    It is good to set this value in datatable in your .cs page. So nothing to worry at report side and no headache for what will come, why not show like that.

    Still if you want in report side. then take one variable and remove (blank) string like

    (use mid for get substring, INSTR for search and get index )

    var left_part = MID(my_string, (INSTR(my_string, "(blank)")) ));
    var right_part = MID(my_string, left_part.len , (INSTR(my_string, "(blank)"))) );
    return left_part + right_part;

    see link



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 16, 2012 1:51 AM