locked
export to CSV has extra comma when suppress field RRS feed

  • Question

  • User1772494043 posted

    Anyone pls, I am running into an issue,

    when conditionally suppress a filed and then export to csv file, the field does not display in csv file(OK), but the comma for this field is still there(BAD)!

    I am using Cyrstal report 12 version!  Any help is appreciated!

     

     

    Tuesday, September 10, 2013 11:43 AM

Answers

All replies

  • User1772494043 posted

    Thank you Ajay!  So, are you saying there is no way to erase extra comma if using a not-null suppress condition when exporting to csv file?

    I did a very simple test, all my 3 fields are constant text and in a single Detail Section, then I suppress the 2nd one with a very simple condition, even I comment out the condition (leave Suppress checkbox on), it still give me 2 commas which I expect one!    Only if there is nothing inside suppress condition, it worked! Is there any work around to archeive this?   I read the links from your post, no finding!

    Wednesday, September 11, 2013 10:15 AM
  • User-578610739 posted

    I never do that, but you are right and as the logic suggest in above link said, that there if give direct suppress will work.

    but when give conditionaly will calculate the data and on that suppress. So if we give format for numeric data , it will remain comma and report does not suppress that thing and export that thing as it is.

    please do exercise as you have done with static variable.

    One thing to remain is suppress always need return true/false so give all condition in conditional suppress which gives you desired result.

    In your case suppress the comma too , if you have. like

    var inputString = fieldname
    if( Replace (inputString, ",", "") == "")   //give all conditional which force return true to suppress
       true
    else
       false



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 12, 2013 2:28 AM