Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Display line feeds in portlet vs. wrapping the data

SOLVED
Go to solution
Highlighted
ljokirk
Member

Display line feeds in portlet vs. wrapping the data

On the Project Details Page, we added two fields, Accomplishments This Period and Plan for Next Period. These fields are stored in the database as VARCHAR(2). Many times the info is entered on separate lines viewing like a list.

On the Project Summary Page, we added a simple portlet which displays the 'Accomplishments This Period' and 'Plan for Next Period' fields. These fields don't display the line feed/carriage return and wrap the data in the portlet even though the database stores the line feed if there.

Is there a way to display the data in the portlet as it was entered and stored - with the line feeds vs. having the data wrap? See attached.
12 REPLIES
Sascha Mohr_1
Esteemed Contributor
Solution

Re: Display line feeds in portlet vs. wrapping the data

Hi.
We have used this tag in notifications to force this:
prj.ACCOMPLISHMENTS

Try using this in your SQL and set the "source contains HTML" flag in the column config of the portlet definition.
Maybe it works there two. Unfortunately the text needs more room this way but in notification we did not care.
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

Hi,
Thanks! I had to modify the syntax slightly, but it helped. Here's the syntax:
'
' || prj.ACCOMPLISHMENTS || '
'
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

Thought I had this figured out....not!

It appears that pre width is not compatible with IE 7 so the width syntax wasn't really working.

I'm trying to control the portlet view when these fields get large or don't contain line feeds. I've incorporated pre and word-wrap commands in the SQL for the fields which helped the non-word wrapping that was originally happening. This makes all of the portlets on the Project Overview Page stretch past the page boundaries and causes the print of the export to PDF to look very small.

How can I prevent this from happening without the custom portlet looking out of whack and the Project Overview Page from displaying past the boundaries? See attached.
Sascha Mohr_1
Esteemed Contributor

Re: Display line feeds in portlet vs. wrapping the data

Hi,
can you upload your attachment again, maybe in a different format? I cannot access it. I just saw the width parameter indeed is deprecated. While Firefox should still interpret it IE7 seems not to do.
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

Here's the portlet display
Sascha Mohr_1
Esteemed Contributor

Re: Display line feeds in portlet vs. wrapping the data

You could try CSS here like
...
, I have never done this though.
While width is deprecated as a direct attribute to the pre-tag CSS should work. With CSS you can also set the font style explicitly (including the size).
If that still does not give you the result you need, you could dive deeper into HTML and warp the content of the column wit a single table cell.
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

Ignore the last attachment I sent. It was the original. Here's the latest. I also have the Data Source Detail Report and Portlet Definitions Details Report available if needed.
Sascha Mohr_1
Esteemed Contributor

Re: Display line feeds in portlet vs. wrapping the data

If I understood that correctly, the "word-wrap: break-word" just means that you allow words to be broken into two parts if they are too long for one line. Instead of going for 50% width, have you tried to set absolute values here?
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

I did try setting the width values. It impacts what is displayed in the cell. See attached.

I'm beginning to think the problem is with the portlet column widths. I don't know how to control that. Is this being controlled by style sheets? If so, I do not want to modify the global style sheets.

Is there a way I can control the column widths and I don't mean small, medium, large? Can this portlet be created some other way (e.g. Java) than it has been created?
Alexandru Saven
Regular Collector

Re: Display line feeds in portlet vs. wrapping the data

Never tried it, but I think it could work by replacing the line feed stored in Oracle with the br HTML tag - you can use regular expressions to achieve this(the implementation of the query depends on the line separator used in your platform):
SELECT REGEXP_REPLACE(COLUMN_NAME,'[^[:alnum:]]{2}', '
') FROM TABLE_NAME;

Cheers
Alex
ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

I have a resolution. The following took care of the expansion of the portlet fields and kept the line feed/carriage return/data wrap under control:

REPLACE(prj.ACCOMPLISHMENTS , chr(10), '
') ACCOMPLISHMENTS

REPLACE(prj.NEXT_PERIOD , chr(10), '
') NEXT_PERIOD

Kudos to Matt Clifford for the resolution!

ljokirk
Member

Re: Display line feeds in portlet vs. wrapping the data

See previous response for solution.
//Add this to "OnDomLoad" event