Skip to main content



      Home
Home » Archived » BIRT » how to conditionally specify/show a marker with a script?
how to conditionally specify/show a marker with a script? [message #152629] Tue, 11 April 2006 14:11 Go to next message
Eclipse UserFriend
Originally posted by: mikewulkan.flyingmoose.ca

Hi,

I would like to set the marker value and visibility based on some attributes
in the data. A script would be the most likely way to go but I have no idea
how to reference the marker and set it's attributes?

Thanks in advance,
Mike
Re: how to conditionally specify/show a marker with a script? [message #152758 is a reply to message #152629] Tue, 11 April 2006 18:25 Go to previous messageGo to next message
Eclipse UserFriend
Most of the time you would just want to use the expression builder that is
launched as part of the Visibility propery where
you can access row data.

If you want to do it in script you have to do something like this
This is on the oncreate event for a data element and means
hide this element for pdf and html when the value of the element is greater
than 14,000.
If you only want to hide for pdf put "pdf" only in the string.
if( this.getValue() > 14000 ){

this.getStyle().setVisibleFormat("viewer, pdf");

}

Jason


"Mike Wulkan" <mikewulkan@flyingmoose.ca> wrote in message
news:e1grgv$gpj$1@utils.eclipse.org...
> Hi,
>
> I would like to set the marker value and visibility based on some
> attributes
> in the data. A script would be the most likely way to go but I have no
> idea
> how to reference the marker and set it's attributes?
>
> Thanks in advance,
> Mike
>
>
Re: how to conditionally specify/show a marker with a script? [message #154911 is a reply to message #152758] Thu, 20 April 2006 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: mikewulkan.flyingmoose.ca

I may not have been completely clear in what I am attempting to do.

I have a scripted datasource. I would like to set the values of two marked
ranges dynamically by accessing methods via JavaScript to obtain the desired
start and end values of the ranges. I currently have hardcoded some values
of the marked ranges and have found the related xml fragment that
corresponds to these marked ranges (attached below).

From this xml I think I want to manipulate the <Value> element of the
<MarkerRanges>.

1) I need to know where to attach/hook this script?
2) How do I find and modify the appropriate elements?

I am fairly new to this so an example code snippet would be much more
appreciated than an general description... although I'll take just about
anything to point me in the right direction. ;-)

<MarkerRanges>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Visible>true</Visible>
</Outline>
<Fill xsi:type="attribute:ColorDefinition">
<Transparency>34</Transparency>
<Red>254</Red>
<Green>0</Green>
<Blue>0</Blue>
</Fill>
<StartValue xsi:type="data:NumberDataElement">
<Value>0.0</Value>
</StartValue>
<EndValue xsi:type="data:NumberDataElement">
<Value>31.0</Value>
</EndValue>
<Label>
<Caption>
<Value>&lt;undefined></Value>
<Font>
<Alignment/>
<Rotation>90.0</Rotation>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
<LabelAnchor>North_West</LabelAnchor>
</MarkerRanges>


"Jason Weathersby" <jweathersby@actuate.com> wrote in message
news:e1hac2$v52$1@utils.eclipse.org...
> Most of the time you would just want to use the expression builder that is
> launched as part of the Visibility propery where
> you can access row data.
>
> If you want to do it in script you have to do something like this
> This is on the oncreate event for a data element and means
> hide this element for pdf and html when the value of the element is
greater
> than 14,000.
> If you only want to hide for pdf put "pdf" only in the string.
> if( this.getValue() > 14000 ){
>
> this.getStyle().setVisibleFormat("viewer, pdf");
>
> }
>
> Jason
>
>
> "Mike Wulkan" <mikewulkan@flyingmoose.ca> wrote in message
> news:e1grgv$gpj$1@utils.eclipse.org...
> > Hi,
> >
> > I would like to set the marker value and visibility based on some
> > attributes
> > in the data. A script would be the most likely way to go but I have no
> > idea
> > how to reference the marker and set it's attributes?
> >
> > Thanks in advance,
> > Mike
> >
> >
>
>
Previous Topic:Controlling Column width in PDF
Next Topic:Using Javascript to access report design parameters
Goto Forum:
  


Current Time: Mon May 12 13:01:34 EDT 2025

Powered by FUDForum. Page generated in 0.04036 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top