Jump to content
Changes to the Jaspersoft community edition download ×

Don't show some Fields from xml database.


2005 IR Help

Recommended Posts

By: mauricio cordero - maucorpat2

Don't show some Fields from xml database.

2005-08-02 08:29

this is my xml datafile:

 

<?xml version="1.0" encoding="UTF-8"?>

<ALERTAS>

<CreationData>2005-08-02 16:18:09.839</CreationData>

<Type>Informe Alertas</Type>

<HighAlertsNum>1679</HighAlertsNum>

<HighAlertsAvg>06:06:34.115363</HighAlertsAvg>

<MediumAlertsNum>199</MediumAlertsNum>

<MediumAlertsAvg>3 days 03:09:25.320005</MediumAlertsAvg>

<LowAlertsNum>2</LowAlertsNum>

<LowAlertsAvg>00:04:29.571</LowAlertsAvg>

<Grupo Name="EPSC">

<AP NameX="apepsc01">

<NumAlertsHigh>0</NumAlertsHigh>

<AvgAlertsHigh />

<NumAlertsMed>0</NumAlertsMed>

<AvgAlertsMed />

<NumAlertsLow>0</NumAlertsLow>

<AvgAlertsLow />

</AP>

<AP NameX="apepsc02">

<NumAlertsHigh>0</NumAlertsHigh>

<AvgAlertsHigh />

<NumAlertsMed>0</NumAlertsMed>

<AvgAlertsMed />

<NumAlertsLow>0</NumAlertsLow>

<AvgAlertsLow />

</AP>

</Grupo>

<Grupo Name="Aula Masters A3">

<AP NameX="wlccn01">

<NumAlertsHigh>0</NumAlertsHigh>

<AvgAlertsHigh />

<NumAlertsMed>0</NumAlertsMed>

<AvgAlertsMed />

<NumAlertsLow>0</NumAlertsLow>

<AvgAlertsLow />

</AP>

<AP NameX="wlccn02">

<NumAlertsHigh>0</NumAlertsHigh>

<AvgAlertsHigh />

<NumAlertsMed>0</NumAlertsMed>

<AvgAlertsMed />

<NumAlertsLow>0</NumAlertsLow>

<AvgAlertsLow />

</AP>

</Grupo>

 

---------------------

PROBLEM = dont show the AP with atribute NameX="apepsc02" and the AP with atribute NameX="wlccn02". Just showing the first field AP after field Grupo.

 

---------------------

 

Configuration of my variable:

 

record path = /ALERTAS/Grupo

 

I have two bands of groups first band "Grupo "

Group expresion = $F{Grupo}

 

and second band group "AP"

Group expresion = $F{AP}

 

 

$F{Grupo}

field description = @Name

 

$F{AP}

field description = AP/@NameX

 

-------------------------------

 

:-(.

 

Oscar.

 

 

 

 

By: Wal Millard - walmillard

RE: Don't show some Fields from xml database.

2005-08-02 17:08

Oscar,

 

Just set your calling datasource (xpath) expression like this...

 

this will display all values of NameX attribute of AP.

 

/ALERTAS/Grupo/AP[@NameX !='']

 

NOTE double ' (single quotes = not empty string)

 

Now to exclude a known tag attributename use

 

/ALERTAS/Grupo/AP[@NameX !=apepsc02]

 

Now if you want to exclude 2 names, then you must ask 2 questions of the expression... like this...

 

/ALERTAS/Grupo/AP[(@NameX !='apepsc02') and (@NameX !='wlccn02')]

 

have a look at the Syntax of XPath here (english)

 

http://www.w3schools.com/xpath/xpath_syntax.asp

 

 

luck

walmillard

 

 

 

 

 

 

 

 

 

By: Wal Millard - walmillard

RE: Don't show some Fields from xml database.

2005-08-02 17:46

 

Oscar,

 

Just had another thought... If you dont know the name of the attribute (NameX) ahead of time then the above will be useless!

 

Use this xpath expression...

 

//ALERTAS/Grupo[@Name !='']/AP

 

This will just select the 1st AP node from each of Grupo Tags.

 

also my Field descriptions were...

 

../@Name for Grupo Name attribute / field

 

and

 

@NameX for AP NameX attribute / field

 

 

luck (again)

walmillard

 

 

 

 

By: mauricio cordero - maucorpat2

RE: Don't show some Fields from xml database.

2005-08-05 01:31

JAJAJAJAJA, thanks to much walmillard, the second post was the solution.

 

again thanks to much, for you time. and if you coming to spain just letme know maucorpat@hotmail.com

 

 

 

 

By: Wal Millard - walmillard

RE: Don't show some Fields from xml database.

2005-08-11 23:39

 

hey no problemo. i was in spain in 03 for Metal festival. Spain rocks!

 

http://www.metalwayfestival.com/

 

if youre ever in Australia...

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...