2 Replies Latest reply on Nov 20, 2012 3:04 PM by BIPuser

    Comma between address lines in BI Publisher


      I've never used BI Publisher before and have little XML experience and need to resolve the following issue (unfortunately the analysts that usually resolve these BI Publisher issue are not available for next few weeks)

      I have 2 fields on .RFT template called CITY, STATE

      Because of the restrictions of the amount of space for the address, there have been defined on the same line

      CITY , STATE

      CITY and STATE are obtained from the XML whereas currently the comma is just text between the 2 fields

      Hence, depending on the values of CITY and STATE the report currently outputs one of the following 3 results

      CITY ,
      CITY , STATE
      , STATE

      The user has asked to only include the comma if both CITY & COUNTY contain a value, otherwise the comma should not be included

      Firstly, I've removed the comma text from the report

      This is my test XML

      <?xml version="1.0" encoding="UTF-8" ?>

      tried to add it as part of the CITY field using

      <?if CITY!='' and STATE!=''?><?CITY?>,<?end if?>

      but it still returns


      I've tried lots of different things, but as I said, this is all new to me and hence I'm not really too sure if what i'm doing is correct

      Please can anybody help with this ?
        • 1. Re: Comma between address lines in BI Publisher
          so what u need is if city or state is null you need to show only the value whic is not null and without ,

          if you have both then u need like CITY,STATE

          try the below logic keep the entire below logic in a form field

          <?xdofx:if (CITY!='' and STATE!='') then concat(CITY,',',STATE) else if (CITY='' and STATE!='') then STATE else if (CITY!='' and STATE='') then CITY else '' end if?>
          • 2. Re: Comma between address lines in BI Publisher
            Use conditional logic to display teh address line. Use this: Include a form field and copy the following code into the form field.

            <?when:CITY!='' and STATE!=''?><?concat(CITY, ‘,’, STATE)?>
            <?end when?>
            <?when:CITY!='' and STATE=''?><?CITY?>
            <?end when?>
            <?when:CITY='' and STATE!=''?><?STATE?>
            <?end when?>
            <?end choose?>

            1 person found this helpful