How to get the Project Description Text Into a Report

We have had several HOC customers say that they wanted to be able to export a report, that includes the Volunteer Opportunity Name and also its description.

The problem is:  In order to make project descriptions look attractive on the public site, project descriptions are created in the WYSIWYG editor and are made up of html.

As a result, you can only get html project descriptions in reports.

However -- if its important to you to be able to do this (because you need a 'hard copy' of your projects and their descriptions - there is a somewhat painless way you can do it through some easy manual manipulation.

When we create an opportunity description in the WYSIWYG editor, the description field actually is HTML.

When we create an opportunity description in the WYSIWYG editor, the description field actually is HTML.

Here's how it looks in the field "Description".

And that is what that field will look like in a report.  Not very readable :-(

What we need is a new field in which we can put a text only version of the project description.  Unfortunately, Salesforce does not have a native feature to 'strip' html

Report View of Description Field

Report View of Description Field

In Report view -- the description is truncated, but we'll see it all if we export to excel

Exported Report in Excel

Exported Report in Excel

We can see it all. But it's all html.

What's needed is a new field where we keep a text-only version of the project description.

There's no way to automate this process... but we can manually get what we need.  Here's how:

Create a New Field

Create a New Field

Create a new custom field for the Volunteer Opportunity object and place it on the page layout.

We'll create a new field called Description (Text), of data type Long Text Area.  I've put in a description and help text.

See these posts:

Adding Custom Fields to an Object

Modifying Page Layouts

You'll need to manually populate this field with just the text of your project description

A bit of extra work - but you now want to have both the WYSIWYG based html project description (the one you normally create when you create a volunteer opportunity), and your text-only version of the description as well.

You can manually type or paste it in of course..... but here's a trick that makes it pretty simple:

Open the WYSIWYG Editor after you have created the project description:

Open the WYSIWYG Editor after you have created the project description:

Now Select ALL the text you see and copy it to your clipboard. (In the WYSIWYG view -- not in the source code)

I have selected all the text, and now COPY it to my clipboard.

Then close the description field.

 

 

Double click on your new "Description (text)" field and PASTE the clipboard contents into the field

Double click on your new "Description (text)" field and PASTE the clipboard contents into the field

Because its a text only field it will just paste in the text.  It won't pick up bold, font formats or hyperlinks.  Just the plain text!  It even preserves the line breaks.

Note: This works in our WYSIWYG editor because it is only a view of the underlying code.  

Alternately - you can try pasting from whatever source you might have written the project description in before using the WYSIWYG editor.  Try cutting and pasting from word... it should work... because the field will only support text characters.

But NOW you have a field in the Volunteer Opportunity Object that is text only, and contains the project description.

Now create a report that meets your need, and use the field "Description (text)" instead of the native "Description" field.

Now create a report that meets your need, and use the field "Description (text)" instead of the native "Description" field.

The field circled above is the text only description.  Much better for your report.  (Though still truncated in the view here - a salesforce limitation on the number of characters you can view in a report field).

Export to Excel to see the complete description  (along with any other fields you want to make part of your report!

 

 

Excel Report showing our new field (left) and the old field contents (right)

Excel Report showing our new field (left) and the old field contents (right)

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.