6 Replies Latest reply: Mar 8, 2012 11:36 AM by Comet RSS

    Character string wraps to new line on tabular form

    Comet
      I created an APEX page that has a tabular form. The form has several columns including one that displays and address column. When the page displays the address column breaks on every space, comma or dash so that a row will take up several lines. For example if I have the address: 555 WEST 180TH STREET, ANY TOWN, NY-99999. It will display on the page as:

      555
      WEST
      180TH STREET,
      ANY
      TOWN,
      NY-
      99999

      I tried setting Column Width on the Report Attributes page and Element Width in the Column Attributes properties to define the column width wide enough to accommodate the address information. The system ignores these values and displays the information broken up as described above. What properties do I need to set to get the address information to display on one line?
        • 1. Re: Character string wraps to new line on tabular form
          fac586
          Comet wrote:
          I created an APEX page that has a tabular form. The form has several columns including one that displays and address column. When the page displays the address column breaks on every space, comma or dash so that a row will take up several lines. For example if I have the address: 555 WEST 180TH STREET, ANY TOWN, NY-99999. It will display on the page as:

          555
          WEST
          180TH STREET,
          ANY
          TOWN,
          NY-
          99999

          I tried setting Column Width on the Report Attributes page and Element Width in the Column Attributes properties to define the column width wide enough to accommodate the address information. The system ignores these values and displays the information broken up as described above. What properties do I need to set to get the address information to display on one line?
          APEX version?

          This is not a tabular form control but a standard report column?

          What's the Display As attribute for the column?

          What's the column name/alias?

          How do you want the address displayed?

          Is there actually any room in the form for the address to be displayed differently to this?
          • 2. Re: Character string wraps to new line on tabular form
            Comet
            APEX version?: Application Express 4.0.1.00.03

            This is not a tabular form control but a standard report column?: A tabular report column not a control

            What's the Display As attribute for the column?: Display as test (escape special characters, does not save state)

            What's the column name/alias?: ADDRESS

            How do you want the address displayed?: on one line like: 555 WEST 180TH STREET, ANY TOWN, NY-99999

            Is there actually any room in the form for the address to be displayed differently to this?: Yes


            For Display As attribute I tried Standard Report Column & Display as Text (saves state) with the same results.

            Edited by: Comet on Mar 6, 2012 10:17 AM
            • 3. Re: Character string wraps to new line on tabular form
              fac586
              Take the Column Width off and add the following style sheet to the page HTML Header:
              <style>
              td[headers="ADDRESS"] {
                white-space: nowrap;
              }
              </style> 
              • 4. Re: Character string wraps to new line on tabular form
                Comet
                I added this to the HTML Header and Body attribute on page 11 but it did not correct the problem. I do not know what he means by style sheet. Does he mean type the java script as-is into the attribute field?
                • 5. Re: Character string wraps to new line on tabular form
                  fac586
                  Comet wrote:
                  I added this to the HTML Header and Body attribute on page 11 but it did not correct the problem. I do not know what he means by style sheet.
                  He means an embedded style sheet contained in an HTML <tt>style</tt> element.
                  Does he mean type the java script as-is into the attribute field?
                  It's CSS, not JavaScript, and it should be entered into the page HTML Header attribute.

                  If there's still a problem, please reproduce this on apex.oracle.com so we can see what's going on.
                  • 6. Re: Character string wraps to new line on tabular form
                    Comet
                    FYI here is how we solved the formatting problem:

                    In tabular reports we set: Report Attributes >Column Attributes >Column Formatting> CSS Style: white-space:nowrap

                    In interactive reports we set: Edit Page> Java Script > When Page Loads:

                    $('td[headers="ADDRESS"]').attr("style","white-space:nowrap");

                    In this example only Address column is affected. For both of these reports there needs to be directives for each affected field.