5 Replies Latest reply: May 7, 2014 1:39 PM by Joe Upshaw RSS

    Line Breaks in Apex Management/report pages?

    NewApexCoder

      APex 4.2

       

      I have report pages in my apps that include columns like 'Description', 'Purpose', etc. Sometimes users like to bullet point or separate information entered in these fields. So a user may go to the data entry page and enter in information for 'Purpose along the lines of:

       

           - To describe information pertaining to what has nothing to do with anything

       

           - To understand how to post information in a very moderate fashion.

       

       

      See how there are two bullet points, separated by a line break. When you save the information on your data entry page and navigate back to your report page, it comes out like:

       

      - To describe information pertaining to what has nothing to do with anything- To understand how to post information in a very moderate fashion.

       

       

      See how the formatting is gone. Is it possible to capture that same formatting from the data entry page onto the report page?? I usually build custom reports and am trying to tackle this same issue. Using xsl-fo to build a report, if it had the same 'Purpose' section, it would come out unformatted as well. Thoought I'd try starting from the report first to see if I can find a solution at the level.

       

      Any help on this topic would be greatly appreciated. Thanks in advance.

        • 1. Re: Line Breaks in Apex Management/report pages?
          Joe Upshaw

          NewApexCoder,

           

          Kind of a pain but, what you have to do is when the data is saved on the form into which the data is entered, you'll need to replace your line breaks with the HTML code, <br>.

           

          Then, on the report, change the "Display As" Column Formatting setting to "Standard Report Column"

           

          -Joe

          • 2. Re: Line Breaks in Apex Management/report pages?
            NewApexCoder

            I guess with this idea, the user would have to type in '<br>' every time you want a line break. And on the data entry page, in that particular field, you'd see the '<br>'. Unless there was a way / process to replace all line break characters (which I think is /n....I think..or that represents an end line. I forget, I'd have to look it up again) with '<br>'.

             

            Thanks for your input though.

            • 3. Re: Line Breaks in Apex Management/report pages?
              Joe Upshaw

              Well, yes, you can, for sure do that. I don't think it is as hard as you think. The most fool proof way, and the way that will require the least effort on your part, is to do it via a table trigger.

               

              Assume your table is named MY_TABLE and the column into which you want to to this is named DESCRIPTION.

               

              CREATE OR REPLACE TRIGGER TR_SET_HTML_LINE_BREAKS

              BEFORE INSERT

              ON MY_TABLE REFERENCING NEW AS new OLD AS old

              FOR EACH ROW

              DECLARE

                  CRLF CONSTANT CHAR(2) := Chr(13) || Chr(10); 

              BEGIN

               

                  :new.DESCRIPTION = Replace( :new.DESCRIPTION, CRLF, '<BR>' );

                  :new.DESCRIPTION = Replace( :new.DESCRIPTION, Chr(13), '<BR>' );

                  :new.DESCRIPTION = Replace( :new.DESCRIPTION, Chr(10), '<BR>' );

               

              END;

              /

              • 4. Re: Line Breaks in Apex Management/report pages?
                Joe Upshaw

                You could also change the SELECT on the report itself to do this translation when the data is pulled (just nest those Replaces from the trigger above). That would do the same thing and not require you to actually manipulate the data in the DB.

                 

                -Joe

                • 5. Re: Line Breaks in Apex Management/report pages?
                  Joe Upshaw

                  Did these suggestions work for you? If so, mind marking one of the answers as Correct?

                   

                  Thanks,

                   

                  -Joe