Mailto link formatting for exports

Stimulsoft Reports.NET discussion
Post Reply
pfaulty
Posts: 3
Joined: Wed Mar 20, 2013 10:44 pm

Mailto link formatting for exports

Post by pfaulty »

I have email addresses coming in from a BusinessObject. I would like to have these email addresses displayed in a report and hyperlinked using the mailto tag.
In the web report they look great if I do something like this in a text component:

Code: Select all

Email: <a href='mailto:{BusinessObject.Email}'>{BusinessObject.Email}</a>
Alternatively I can use Behavior > Interaction and place the following to get similar results.

Code: Select all

<a href='mailto:{BusinessObject.Email}'>{BusinessObject.Email}</a>
When I export to PDF, Word or Excel though I get the full text:
This is to be expected, but it is not the desired outcome. Ideally I'm looking for a solution that would hyperlink via mailto for the email addresses in the web report (which I have successfully done) AND display just the email address (doesn't necessarily have to be hyperlinked) in the PDF/Word/Excel exports.

Perhaps there is a condition I could use.

Thanks.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Mailto link formatting for exports

Post by HighAley »

Hello.

Unfortunately, we support limited set of html tags. You could read about it in our documentation.
But there is a Hyperlink property of the text component. Please set its value.

Thank you.
pfaulty
Posts: 3
Joined: Wed Mar 20, 2013 10:44 pm

Re: Mailto link formatting for exports

Post by pfaulty »

Thanks for the reply Aleksey,

I mentioned the Hyperlink property in my initial post (Behavior > Interaction).
The main issue for us is that if I use ANY HTML tags and export to Excel I get an image file for that field instead of text.

Is there a way to remove a part of a string from being displayed in an export?
eg. Email: <a href='mailto:firstname.lastname@company.com'>firstname.lastname@company.com</a>
in the Export I would like to get just Email: firstname.lastname@company.com

Currently I am able to hyperlink using my first method (in initial post) without using HTML tags (Allow HTML Tags set to false).
I figured it was a long shot for this to have a solution, but thought I'd at least ask. Thanks.
pfaulty
Posts: 3
Joined: Wed Mar 20, 2013 10:44 pm

Re: Mailto link formatting for exports

Post by pfaulty »

Thanks Aleksey,

Figured it out.
For web reports (in Stimulsoft Designer) create a text field for "Email" and a text field for the address itself.
[Email:][firstname.lastname@company.com]

Take the address field and in the properties tab go Behavior > Interaction > Hyperlink as Aleksey had mentioned.
In this field you will want to place "mailto:{BusinessObject.Email}" (without the quotes)

In the web report it will not stylize the mailto links so you'll have to manually change the color of the address field text and you can underline if you want to make it look more like a link.

Doing it this way will allow the web reports to have mailto functionality (click on the link and your Outlook or email client will direct to this address)
It also allows for all exports (only tested with Word, Excel and PDF) to display the address field as text (not images) and retain the clickable field as well. So keep Allow HTML Tags set to false.

The missing piece of my puzzle was the mailto keyword without all the <a href="mailto:"... I was stuffing into Interaction.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Mailto link formatting for exports

Post by HighAley »

Hello.

We are glad to work with such costumers.
Let us know if you will need any additional help.

Thank you.
Post Reply