Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert hyperlink using code

Status
Not open for further replies.

MTarkington

Programmer
Feb 14, 2001
73
US
I have a report that will just be listing states in a group header. Within this header, the state will be listed once, but I want it to be a hyperlink.

The hyperlink should display e-mail addresses within that state.

If I use a function, I can change it to a hyperlink, but I can't change the e-mail addresses depending on the state. The state would change, but not the e-mail addresses within the hyperlink properties.

I am looking for a way to insert a hyperlink within the code of a function window.

Anyone have any ideas on this?

If further explanation is needed, please let me know.

TIA

 
You can build an expression using the formula button next to the hyperlink address. Something like:

" + {Customer.Region} + ".html" Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I understand what you have described, but when I try to type this in, why doesn't it show up as a hyperlink. It just shows up as a site, not a hyperlink/hypertext.

What kind of syntax would be used to make the hyperlink reflect multiple e-mail addresses? I thought of something to the effect of: "mailto:" + {Manager.Email}, but it didn't work the way I was thinking it would.

Does this sound like something that CR8 can do, or am I asking the impossible?

 
Not sure I get your Qx.

What is the difference between a site and a hyperlink? If it is just formatting, you can format the object to look just about any way you want.

Do you want multiple Email addresses for one object? Or each object to be different based on where it is in the report. If you mean Each Object different, you should be able to do it by formula. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Let me try this again...

Let's say I have 5 offices in each state. Each office has a different e-mail address.

The records are grouped by state.

The hyperlink would be something similar to 'State of AL', which would be a link that would open Outlook and put all of the e-mail addresses within that state in the BCC field.

What I was looking to do was use a nested If to change the text in the field and the e-mail addresses that correspond with the state. I just don't know how to put this into code behind a function.

I hope this clarifies it...

Thanks
 
The formula can only use data that is in the report's result table. It isn't going to be able to open another table and query it.


If you can write another report that generates the email addresses from outlook, you can insert that report as an on-demand subreport. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
The table I am using already has the e-mail addresses included. Does that matter?
 
That helps.

If you use the Email address field in the formula appended to "Mailto" you will get the Email address of the currrent record. That will be the first record of the group if your field is in the group header. If you do it this way, can you get it to work as you want for one Email address?

It will be a pretty complex task to get a group of Email addresses into the formula, and I am not sure that this will activate outlook the way you want. I would first make sure that one works as you want it. If it doesn't there is no sense wasting your time trying to assemble the others. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
In the formula editor, I tried this:
"mailto" + {Office.MgrEmail}

It displays the address, but does not work as a hyperlink. It is just a regular text box.

Is this syntax correct?
 
Yes, but I think it is in the wrong formula editor.
Select this field and then use menu optins "Format - Field". On the hyperlink tab enter the formula again in THIS formula editor. The formula editor on this tab will be the button with an X+2 and a pencil on it. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top