3 Replies Latest reply on May 25, 2021 1:45 AM by Rajdeo Verma

    Can we remove blank rows from excel export file

    ankita sawant Active Member

      Hi ,

       

      We have a PIM export template that generates an xml file but in excel format.We have put a condition in each cell to filter out some data from export but it is cause some blank rows

      We are not able to remove them by standard ways like using functions :  IfEmptyThen or IfNotEmptyThenNotEnc. please suggest

        • 1. Re: Can we remove blank rows from excel export file
          Rajdeo Verma Active Member

          Hi Ankita,

           

          Usually, "IfNotEmptyThen" function helps. Example for export format as below, please share details if it's not helping you.

          {?IfNotEmptyThen "mandatory data", "paragraph starts here
          mid of paragraph

          end of paragraph", "<THIS EXPORTS BLANK WITHOUT LINE-BREAK>"}

           

          Alternatively, you may use data field level validation to filter records, or post-processing batch script for removing line breaks.

           

          Regards,

          Rajdeo

          • 2. Re: Can we remove blank rows from excel export file
            ankita sawant Active Member

            Hi Rajdeo,

             

            Our export looks something like this(since output is an excel) The compare condition,  if false,  is giving blank cells in the row:

             

            <Row>

            <Cell ss:StyleID="s64"><Data ss:Type="String">{?CompareIgnoreCase {&Item.Local Item Business Entity}, {%BusinessEntity},{&Item.Attribute value of Platform (English, DEFAULT)} , }</Data></Cell>

            <Cell ss:StyleID="s64"><Data ss:Type="String">{?CompareIgnoreCase {&Item.Local Item Business Entity}, {%BusinessEntity},{&Item.Local Item Business Entity},}</Data></Cell>

            </Row>

             

            So, here I am not able to use ?IfNotEmptyThen outside <Row> and if I use for every cell, it is not effective in removing the entire row.

            Thats is why probably some script is needed which will work in the end to remove all blank rows created.

             

            Thanks,

            Ankita

            • 3. Re: Can we remove blank rows from excel export file
              Rajdeo Verma Active Member

              Hi Ankita,

               

              You are exporting <row> and <cell> tags in both cases (valid data & non-valid empty), and hence it'll extract empty rows and cells. You'll have to handle these tags as well.

               

              Regards,

              Rajdeo