1 2 Previous Next 28 Replies Latest reply: Jul 21, 2011 12:57 PM by 807466 RSS

    Is it possible to add a newline to a column?

    25631
      Hi,

      So I am wondering if it is possible to add a newline to a column in a SQL report? For example I have 4 columns I am selecting. I want the first two columns to be on one line then have a <br> then the next two columns
      to be on the next line. Is something like this possible?
      I have tried things like
      select column1, column2, '<br/>' || column3, column4
      but that doesnt seem to work.

      Any help would be appreciated

      Thanks in advance!

      Edited by: goochable on Jul 17, 2011 8:38 PM
        • 1. Re: Is it possible to add a newline to a column?
          M Tajuddin
          Hi,
          You can do it in couple of ways -
          1. In SQL report query like -
          SELECT COL1||COL2 "Full Name", COL3||COL4 "Adress" FROM TABLE_NAME
          2. You can do it in the report page. Go to edit page >>Click on edit report column under the page region >>click on edit column one >> Under the HTML expression type -
          #COL_1#   #COL_2#
          #COL_1# and #COL_2# will translate the col1 and col2 value from the report. Change these parameters according to your report column name. Now you can untick (show) the col2 from report column edit to hide. Do the same for other column.

          Hope this helps.

          Regards,
          M Tajuddin
          website: http://tajuddin.whitepagesbd.com
          • 2. Re: Is it possible to add a newline to a column?
            25631
            Hi,

            Thanks for your input! I am not sure that I understand. How exactly do I get a newline by using either of these techniques?

            Thanks again
            • 3. Re: Is it possible to add a newline to a column?
              807466
              Hello -

              I believe that you can use the method you originally mentioned if you set your column to a Standard Report Column. The html in the column value will be rendered as HTML, and, in your case, a new line should be created.

              EDIT: After I did a bit of testing I had to put a space character in my SQL to get it to render:
              SELECT col1, col2, col3||' <br/>', col4 FROM table
              The other thing you can do is put your
              <br/>
              in your Column Formatting field for the column you want.

              Austin

              Edited by: AustinJ on Jul 18, 2011 10:06 AM
              • 4. Re: Is it possible to add a newline to a column?
                25631
                Hi,

                Thanks for the input! Well I am trying the following
                SELECT e.evaluation_note_id, l.description, u.FIRST_NAME || ' ' || u.LAST_NAME  || ' <br/>' debriefer, e.evaluation_note, 
                '<b><a href="javascript:OpenPopup(6,' || chr(39) || 'P6_EVALUATION_NOTE_ID' || chr(39) || ',' || e.evaluation_note_id || ');">Notes</a>' "Notes"
                  FROM evaluation_notes e, users u, lookups l
                 WHERE u.user_id = e.created_by
                   AND e.evaluation_id = :P2_EVALUATION_ID
                   AND UPPER(l.lookup_type) = 'EVALUATION_TYPE'
                 ORDER BY e.evaluation_note_id
                still doesnt seem to be working. Which field exactly is the "Column Formatting field"?

                Thanks again
                • 5. Re: Is it possible to add a newline to a column?
                  25631
                  I assume you mean the "HTML Expression" in the Column Attributes
                  I tried putting in
                  #DEBRIEFER#<br/>
                  still doesnt seem to work...
                  • 6. Re: Is it possible to add a newline to a column?
                    25631
                    And yes it is a "Standard Report Column" type
                    • 7. Re: Is it possible to add a newline to a column?
                      M Tajuddin
                      Did you turn off strip HTML in report? Go to edit report attributes and under the Layout and Pagination change the Strip HTML to NO. Otherwise it will strip all html codes.

                      Cheers,
                      Tajuddin
                      • 8. Re: Is it possible to add a newline to a column?
                        25631
                        Hi,

                        Thanks yes I do have "Strip HTML" set to NO. And any other tag I put in HTML Expression for example
                        <span style="color:red;font-weight:bold;">#DEBRIEFER#</span>
                        works fine. Just the
                        <br/>
                        Isnt working hence I am wondering if what I am trying to do is possible?
                        • 9. Re: Is it possible to add a newline to a column?
                          M Tajuddin
                          I would probably try this -
                          <p style="color:red;font-weight:bold;">#DEBRIEFER#</p>
                          <p style="color:red;font-weight:bold;">#OTHER_COLUMN#</p>
                          Cheers,
                          Tajuddin
                          • 10. Re: Is it possible to add a newline to a column?
                            807466
                            Hello -

                            Yes, I was referring to the HTML Expression on the Column Formatting.

                            Interestingly enough when I use:
                            <br/>#COLUMN_NAME#
                            Then the BR appears, however, if I use:
                            #COLUMN_NAME#<br/>
                            Then the BR does not. Hence, I put a space character after the br tag and then it does put in the additional line.

                            Incidentally, i use the & nbsp; syntax to insert the space.

                            Austin
                            • 11. Re: Is it possible to add a newline to a column?
                              25631
                              Hi Austin,

                              Thanks for your help! Neither of those options seem to work. What am I doing wrong?
                              I have a Reports Region form a SQL Query
                              SELECT e.evaluation_note_id, l.description, u.FIRST_NAME || ' ' || u.LAST_NAME || ' <br/>' debriefer, e.evaluation_note, 
                              '<b><a href="javascript:OpenPopup(6,' || chr(39) || 'P6_EVALUATION_NOTE_ID' || chr(39) || ',' || e.evaluation_note_id || ');">Notes</a>' "Notes"
                                FROM evaluation_notes e, users u, lookups l
                               WHERE u.user_id = e.created_by
                                 AND e.evaluation_id = :P2_EVALUATION_ID
                                 AND UPPER(l.lookup_type) = 'EVALUATION_TYPE'
                               ORDER BY e.evaluation_note_id
                              I have all of the columns set to "Standard Report Column"
                              I have "Strip HTML" set to No

                              I have tried using the HTML Expression as you have suggested below. I have tried putting the
                              ' <br/>'
                              in the query. But none of these options seem to create a newline for each row.

                              Do I need to create a Custom Region to get this functionality?

                              Thanks again
                              • 12. Re: Is it possible to add a newline to a column?
                                25631
                                Hi,

                                I have create a test workspace maybe someone can show me there how it is done?

                                Workspace: TEST_BR
                                Username: guest
                                Password: test123


                                http://apex.oracle.com/pls/apex/

                                currently there is a
                                <br/>#JOB#
                                in the job column it appears to do a newline but inside the column. I want the job column to be on the line below ename and empno
                                • 13. Re: Is it possible to add a newline to a column?
                                  M Tajuddin
                                  Hi,
                                  Check your report now. Is this what you want to do? I am not sure yet.

                                  Cheers,
                                  Tajuddin
                                  • 14. Re: Is it possible to add a newline to a column?
                                    807466
                                    Hello -

                                    Please, let me restate the original question in my own words so that I can make sure I understand the requirements.

                                    In the SQL output you have records and columns (I will refer to these as SQL.records and SQL.columns)
                                    In the HTML table that is produced by the report you have rows and columns (HTML.rows and HTML.columns, repectively)

                                    Now, for every SQL.record that is to be displayed, you would like to have two HTML.rows created. The first HTML.row contains some, but not all values from the SQL.record. The second HTML.row contains the remaining values of the SQL.record, in their appropriate HTML.columns, that were not displayed in the previous HTML.row.

                                    Is this what you are attempting to achieve?

                                    Austin
                                    1 2 Previous Next