|
|
|
Re: Changing style of hyperlinks [message #694483 is a reply to message #693889] |
Fri, 08 July 2011 17:27   |
|
Mike
Did you try the text element approach?
<a href="http://www.google.com"
style="text-decoration:none;color:green;font-size:9pt"
onmouseover="this.style.color = 'tan'"
onmouseout="this.style.color = 'green'">
<VALUE-OF>row["ORDERNUMBER"]</VALUE-OF></a>
Jason
On 7/7/2011 9:03 AM, Mike Wulkan wrote:
> I tried the onRender technique as described in one of the links you
> kindly provided.
> I put in:
> this.getStyle().textTransform = "UPPERCASE";
> just to see if it was working and this worked fine but as far as
> underlines go I tried
>
> this.getStyle().textUnderline = "FALSE";
> this.getStyle().textUnderline = "";
> this.getStyle().textUnderline = "false";
> this.getStyle().textUnderline = false;
>
> and none of them seemed to have any effect.
>
>
|
|
|
Re: Changing style of hyperlinks [message #694485 is a reply to message #693889] |
Fri, 08 July 2011 17:27   |
|
Mike
Did you try the text element approach?
<a href="http://www.google.com"
style="text-decoration:none;color:green;font-size:9pt"
onmouseover="this.style.color = 'tan'"
onmouseout="this.style.color = 'green'">
<VALUE-OF>row["ORDERNUMBER"]</VALUE-OF></a>
Jason
On 7/7/2011 9:03 AM, Mike Wulkan wrote:
> I tried the onRender technique as described in one of the links you
> kindly provided.
> I put in:
> this.getStyle().textTransform = "UPPERCASE";
> just to see if it was working and this worked fine but as far as
> underlines go I tried
>
> this.getStyle().textUnderline = "FALSE";
> this.getStyle().textUnderline = "";
> this.getStyle().textUnderline = "false";
> this.getStyle().textUnderline = false;
>
> and none of them seemed to have any effect.
>
>
|
|
|
|
Re: Changing style of hyperlinks [message #694567 is a reply to message #694531] |
Fri, 08 July 2011 21:02   |
|
Mike,
Try adding a text element with some script like:
<script type="text/javascript">
function doAll(){
var anchors = document.getElementsByTagName('A');
for (ii=0;ii<anchors.length;ii++) {
anchors[ii].style.textDecoration="none";
}
}
doAll();
</script>
Jason
On 7/8/2011 3:16 PM, Mike Wulkan wrote:
> I didn't because the link is a drill down to another report and I didn't
> know how to easily construct the URL for it and get the same behavior
> that I generate from the GUI.
|
|
|
|
Re: Changing style of hyperlinks [message #817273 is a reply to message #817112] |
Fri, 09 March 2012 21:50   |
|
Mike
Change your doAll function to something like:
function doAll(){
var anchors = document.getElementsByTagName('A');
for (ii=0;ii<anchors.length;ii++) {
if( anchors[ii].parentNode.id ){
if (anchors[ii].parentNode.id.indexOf("myhyperlink") !=-1) {
anchors[ii].style.textDecoration="none";
}
}
}
}
Then in the data elements that you want to change set a bookmark
expression to something like:
"myhyperlink"+row.__rownum
Jason
On 3/9/2012 11:48 AM, Mike Wulkan wrote:
> Hi Jason,
> I added the code as described and it works great. Now the only issue
> that I have is that I'd like to limit the anchors to which the doAll
> function processes. Currently this function changes the style of all the
> links on the page. Is there a way of giving an id to certain links and
> then conditioning the body of the loop to check for some sort of naming
> convention to decide how to set the style?
> I'm using the GUI to generate the drill-through hyperlinks so I'm just
> not sure if and where you can set an id attribute on the link and how
> one could reference it in the script?
>
> Thanks,
> Mike
|
|
|
|
Re: Changing style of hyperlinks [message #819193 is a reply to message #819101] |
Mon, 12 March 2012 15:56   |
|
Mike
Do you mean the general report property title?
If so you should be able to access it in server side script or in an
expression like:
reportContext.getDesignHandle().getProperty("title");
Jason
On 3/12/2012 9:48 AM, Mike Wulkan wrote:
> Thanks Jason, works like a charm :d
> If I could trouble you for one more tweak.
>
> What I am attempting to do is create a header with links to the other
> pages in my report. The code you have provided takes care of removing
> the underlines from these links. I have the header specified as a grid
> element in my rptlibrary and have included it at the top of each of my
> reports. What I would like is that the link associated with the
> currently displayed report be formatted specially to indicate that it is
> the current page.
> I was thinking I could do that by comparing the bookmark that I have now
> added to the link element as per your current suggestion (I named each
> explicitly rather than using rownum) , with the title of the report. I
> could do this as a highlight condition for the link element.
>
> The one part of this I am not sure how to achieve is retrieving the page
> title attribute in this context?
|
|
|
|
|
Re: Changing style of hyperlinks [message #819393 is a reply to message #819216] |
Mon, 12 March 2012 21:44   |
|
What do you mean dynamic? If its a label within the report and it is
named you can gets its design time value using:
reportContext.getDesignHandle().findElement("mylabel").getText();
Jason
On 3/12/2012 12:31 PM, Mike Wulkan wrote:
> Yup, that is exactly what I wanted.
>
> Finally (I hope), is there a way to make a dynamic reference to the text
> of a label element within a highlight script?
> I currently have:
> reportContext.getDesignHandle().getProperty("title").indexOf("Home") == 0
>
> but I'd like to replace the string "Home" with a reference to the text
> of the label element so that I could use the same script for all my TOC
> links without having to hard-code the same text string in the script.
|
|
|
Re: Changing style of hyperlinks [message #819397 is a reply to message #819220] |
Mon, 12 March 2012 21:45   |
|
If you open up the library you should be able to add styles there.
Jason
On 3/12/2012 12:35 PM, Mike Wulkan wrote:
> Okay I lied... one more thing,
>
> In the highlight dialog, I see a drop-down for Apply Style. Currently it
> is set to None but the list is empty. On my regular report pages I see
> that I can create a named Style but this element is in a rptlibrary and
> for some reason there is not Style definition section. So how do I
> define a common style that I can use in my highlight definition so that
> I don't have to code it separately for each link?
|
|
|
|
Re: Changing style of hyperlinks [message #820085 is a reply to message #819872] |
Tue, 13 March 2012 17:52   |
|
I do not know of an easy way of doing this.
Styles in Libraries
Expand themes and right click on default and you will see you can add a
style.
Jason
On 3/13/2012 8:33 AM, Mike Wulkan wrote:
> Having to name the label element and find it by name just shifts the
> issue. What I was hoping for was that I could use the relative location
> of where the script is running to find the label so that I wouldn't have
> to know it's name.
> Eg., I have a grid and in each cell I have a label. I would like the
> highlight of the cell to be based on the a script that references the
> text of the label in the cell. I'd like the script to be generic in that
> it could be used for each cell. Having to name the label and reference
> that name in the script defeats this purpose.
>
> Jason, I appreciate your time on this, however you may feel free to
> regard this particular question as low priority as I have already
> implemented this in the non-generic way but am still curious to learn if
> there is a better technique to use in the future.
>
> With regards to the styles in the library. I may just be being thick,
> but I don't see any place to add styles in the library.
> In the outline view of the library I see:
> ...
> MasterPages
> Themes
> Embedded Images
> Libraries
> Scripts
>
> However in the outline view of a rptdesign is see:
> MasterPages
> Styles
> Embedded Images
> Libraries
> Scripts
>
> Why is the Styles node not available in outline view of the library? Is
> this not the place where I would add a style? In the rptdesign file I
> can right click this node and select New Style... but there is no place
> I can see to do that in the library?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02999 seconds