Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Hide empty row in crosstab
Hide empty row in crosstab [message #637746] Mon, 08 November 2010 16:33 Go to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Hi,

I need to filter out lines where the values of a measure are null for each value of column dimensions.

See the following scotch for illustration:
          | d1:1        | d1:2        |
          | d2:1 | d2:2 | d2:1 | d2:2 |
d3:1 | m1 | 1    | 2    | null | 4    |
     | m2 | null | null | null | null |
     | m3 | null | null | 1    | 2    |
d3:2 | m1 | 1    | 2    | 3    | 4    |
     | m2 | 1    | 2    | 3    | 4    |
     | m3 | null | null | null | null |

Lines 2 and 6 should be hides.

There is a hide attribute for measures, but it is unconditional.

What is the right way for this.

Thanks,
Marco

[Updated on: Mon, 08 November 2010 16:43]

Report message to a moderator

Re: Hide empty row in crosstab [message #637747 is a reply to message #637746] Mon, 08 November 2010 16:55 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Just saw that there is a field for an expression.

So the question is what is the right expression to check if all values are null.

/m
Re: Hide empty row in crosstab [message #637754 is a reply to message #637747] Mon, 08 November 2010 17:06 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you not just uncheck the show empty rows check box on the Empty
Rows/columns tab of the properties editor?

Jason

On 11/8/2010 11:55 AM, Marco wrote:
> Just saw that there is a field for an expression.
>
> So the question is what is the right expression to check if all values
> are null.
>
> /m
Re: Hide empty row in crosstab [message #637755 is a reply to message #637754] Mon, 08 November 2010 17:32 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Hi Jason,

I don't see such a tab. Are you sure such a tab exists for measures of a cross tab?

BTW: I don't need a GUI access to such a property access via DEAPI would be just fine.

/m
Re: Hide empty row in crosstab [message #637770 is a reply to message #637755] Mon, 08 November 2010 18:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Select the crosstab report item in the canvas and it should be in the
properties view.

On 11/8/2010 12:32 PM, Marco wrote:
> Hi Jason,
>
> I don't see such a tab. Are you sure such a tab exists for measures of a
> cross tab?
>
> BTW: I don't need a GUI access to such a property access via DEAPI would
> be just fine.
>
> /m
Re: Hide empty row in crosstab [message #638803 is a reply to message #637746] Fri, 12 November 2010 15:59 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
I do not find the option mentioned by Jason.

I added HideRules to the Label of the Header and the DataItem of the AggregationCell. Now for empty rows the header is hidden and the height of the row is reduced to a few pixels. But it is still there.

So again my question: How can I simply omit empty rows (measures with no values in any column dimension)?

Thanks,
Marco
Re: Hide empty row in crosstab [message #638842 is a reply to message #638803] Fri, 12 November 2010 17:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,

I just sent you a report and image that shows the location to set it.

Jason


On 11/12/2010 10:59 AM, Marco wrote:
> I do not find the option mentioned by Jason.
>
> I added HideRules to the Label of the Header and the DataItem of the
> AggregationCell. Now for empty rows the header is hidden and the height
> of the row is reduced to a few pixels. But it is still there.
>
> So again my question: How can I simply omit empty rows (measures with no
> values in any column dimension)?
>
> Thanks,
> Marco
Re: Hide empty row in crosstab [message #638989 is a reply to message #638842] Sun, 14 November 2010 13:47 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

Thank you for the screen shot. It helped me to find the option.

But the options are disabled by default. So it shouldn't show empty rows anyway. But it does.

What does empty row mean? I mean that my DataSet returns null for a certain measures in every of row of a certain row dimension no matter what the value of the column dimension is.

So if I set a HideRule for this measure with the function COUNT on the group of the row dimension then no values and no label are shown because the count of null values is 0.

I also tried to add a Filter with the same rule (actually the opposite rule (!= 0)). Anyway the result is a row with no text an a height of a few pixels.

What else does empty row mean for the crosstab?

What else can I do to get completely rid of empty rows?

Thanks,
Marco
Re: Hide empty row in crosstab [message #639212 is a reply to message #638989] Mon, 15 November 2010 15:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Empty rows generally mean no value for a specific dimension
intersection. The issue may be that the cube does have a value from the
dataset but it happens to be null.

I am not certain why this approach did not work:
> So if I set a HideRule for this measure with the function COUNT on the
> group of the row dimension then no values and no label are shown because
> the count of null values is 0.

Jason

On 11/14/2010 8:48 AM, Marco wrote:
> Jason,
>
> Thank you for the screen shot. It helped me to find the option.
>
> But the options are disabled by default. So it shouldn't show empty rows
> anyway. But it does.
>
> What does empty row mean? I mean that my DataSet returns null for a
> certain measures in every of row of a certain row dimension no matter
> what the value of the column dimension is.
>
> So if I set a HideRule for this measure with the function COUNT on the
> group of the row dimension then no values and no label are shown because
> the count of null values is 0.
>
> I also tried to add a Filter with the same rule (actually the opposite
> rule (!= 0)). Anyway the result is a row with no text an a height of a
> few pixels.
>
> What else does empty row mean for the crosstab?
>
> What else can I do to get completely rid of empty rows?
>
> Thanks,
> Marco
Re: Hide empty row in crosstab [message #639240 is a reply to message #639212] Mon, 15 November 2010 17:45 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Quote:
Empty rows generally mean no value for a specific dimension
intersection. The issue may be that the cube does have a value from the
dataset but it happens to be null.


What else than null should a scripted dataset return for a missing value?
Re: Hide empty row in crosstab [message #639466 is a reply to message #639240] Tue, 16 November 2010 16:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I should have been clearer. empty rows/cols are for dimensions. For
example if I nest my row by two dimensions if no data exist for a
particular value of the inner dimension that row will not show unless
you use the check box. You can look at the attached report and click
the checkbox to see what I mean. To hide the entire row based on the
value of the measure use the visibility expression (or possibly a
filter). I have used a visibility expression in the attached example.
I place the visibility expression on both the dimension data elements
and the measure data element.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22"
id="1">
<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company
Name here>></property>
<property name="createdBy">Eclipse BIRT Designer Version
2.6.1.v20100902 Build &lt;2.6.1.v20100915-1750></property>
<property name="units">in</property>
<method name="beforeFactory"><![CDATA[myArray = [];
ctr=0;
rctr=0;]]></method>
<property name="layoutPreference">auto layout</property>
<data-sources>
<script-data-source name="Data Source" id="4"/>
</data-sources>
<data-sets>
<script-data-set name="outer" id="5">
<list-property name="resultSetHints">
<structure>
<property name="position">1</property>
<property name="name">dim</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">dimval</property>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">dim</property>
</structure>
<structure>
<property name="columnName">dimval</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">dim</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">dimval</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<method name="open"><![CDATA[i=0;]]></method>
<method name="fetch"><![CDATA[if (i++ >8)
return false;
else {

if( i != 5){
row.dim=i;
}
row.dimval = "Test"+i;

return true;
}]]></method>
</script-data-set>
</data-sets>
<cubes>
<tabular-cube name="Data Cube" id="85">
<property name="dimensions">
<tabular-dimension name="Group1" id="103">
<property
name="defaultHierarchy">NewTabularHierarchy1</property>
<property name="hierarchies">
<tabular-hierarchy name="NewTabularHierarchy1"
id="104">
<property name="levels">
<tabular-level name="dimval" id="105">
<property
name="dataType">string</property>
<property
name="levelType">dynamic</property>
<property
name="columnName">dimval</property>
</tabular-level>
</property>
</tabular-hierarchy>
</property>
</tabular-dimension>
<tabular-dimension name="Group2" id="301">
<property
name="defaultHierarchy">NewTabularHierarchy2</property>
<property name="hierarchies">
<tabular-hierarchy name="NewTabularHierarchy2"
id="302">
<property name="levels">
<tabular-level name="dim" id="303">
<property
name="dataType">integer</property>
<property
name="columnName">dim</property>
</tabular-level>
</property>
</tabular-hierarchy>
</property>
</tabular-dimension>
</property>
<property name="measureGroups">
<tabular-measure-group name="Summary Field" id="89">
<property name="measures">
<tabular-measure name="dim" id="234">
<expression name="measureExpression"
type="javascript">dataSetRow["dim"]</expression>
<property name="dataType">integer</property>
</tabular-measure>
</property>
</tabular-measure-group>
</property>
<property name="dataSet">outer</property>
</tabular-cube>
</cubes>
<styles>
<style name="table-header" id="37">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-footer" id="38">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-detail" id="39">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-header-1" id="40">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-footer-1" id="41">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="special-header" id="42">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-detail" id="43">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-header" id="44">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<extended-item extensionName="Crosstab"
extensionVersion="2.5.0" id="304">
<property name="cube">Data Cube</property>
<property name="measures">
<extended-item extensionName="MeasureView" id="315">
<property name="measure">dim</property>
<property name="detail">
<extended-item extensionName="AggregationCell"
id="316">
<property
name="aggregationOnRow">Group2/dim</property>
<property name="content">
<data id="317">
<list-property name="visibility">
<structure>
<property
name="format">all</property>
<expression
name="valueExpr" type="javascript">if (data["dim_Group2/dim"] == null
){&#13;
true;&#13;
}else{&#13;
false;&#13;
}</expression>
</structure>
</list-property>
<property
name="resultSetColumn">dim_Group2/dim</property>
</data>
</property>
</extended-item>
</property>
<property name="header">
<extended-item extensionName="CrosstabCell"
id="318">
<property name="content">
<label id="319">
<text-property
name="text">dim</text-property>
</label>
</property>
</extended-item>
</property>
</extended-item>
</property>
<property name="rows">
<extended-item extensionName="CrosstabView" id="306">
<property name="views">
<extended-item extensionName="DimensionView"
id="307">
<property name="dimension">Group1</property>
<property name="levels">
<extended-item
extensionName="LevelView" name="NewLevel View" id="308">
<property
name="level">Group1/dimval</property>
<property name="member">
<extended-item
extensionName="CrosstabCell" id="309">
<property name="content">
<data name="dimval"
id="310">
<list-property
name="visibility">
<structure>
<property
name="format">all</property>
<expression
name="valueExpr" type="javascript">if (data["dim_Group2/dim"] == null
){&#13;
true;&#13;
}else{&#13;
false;&#13;
}</expression>
</structure>
</list-property>
<property
name="resultSetColumn">dimval</property>
</data>
</property>
</extended-item>
</property>
</extended-item>
</property>
</extended-item>
<extended-item extensionName="DimensionView"
id="311">
<property name="dimension">Group2</property>
<property name="levels">
<extended-item
extensionName="LevelView" name="NewLevel View1" id="312">
<property
name="level">Group2/dim</property>
<property name="member">
<extended-item
extensionName="CrosstabCell" id="313">
<property name="content">
<data name="dim" id="314">
<list-property
name="visibility">
<structure>
<property
name="format">all</property>
<expression
name="valueExpr" type="javascript">if (data["dim_Group2/dim"] == null
){&#13;
true;&#13;
}else{&#13;
false;&#13;
}</expression>
</structure>
</list-property>
<property
name="resultSetColumn">dim</property>
</data>
</property>
</extended-item>
</property>
</extended-item>
</property>
</extended-item>
</property>
</extended-item>
</property>
<property name="header">
<extended-item extensionName="CrosstabCell" id="305"/>
</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">dimval</property>
<expression
name="expression">dimension["Group1"]["dimval"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">dim</property>
<expression
name="expression">dimension["Group2"]["dim"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">dim_Group2/dim</property>
<expression
name="expression">measure["dim"]</expression>
<property name="dataType">integer</property>
<simple-property-list name="aggregateOn">
<value>Group2/dim</value>
</simple-property-list>
<property name="aggregateFunction">SUM</property>
</structure>
</list-property>
</extended-item>
</body>
</report>


On 11/15/2010 12:45 PM, Marco wrote:
> Quote:
>> Empty rows generally mean no value for a specific dimension
>> intersection. The issue may be that the cube does have a value from
>> the dataset but it happens to be null.
>
>
> What else than null should a scripted dataset return for a missing value?
>
Re: Hide empty row in crosstab [message #639743 is a reply to message #639466] Wed, 17 November 2010 16:16 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

Thanks for the sample. It seems to suffer from the same short coming. The line for Value5 is empty but still there if not omitted based on dimension value. Beside that I do not understand why it stops at this line when show empty rows is activated. Would you explain?

Coming back to my requirement which should not be that uncommon. Imagine you want to report on various scenarios over a period. Each scenario is characterized by some attributes. Columns dimension is the time, row dimension is scenario, the measures are the attributes.

Everything fine, but let's assume some attributes are not relevant or even not defined for certain scenarios. So the measure is empty and I want to omit it for that scenario.

How can I omit that rows? Is there a workaround to hide the full rows. I can hide the text in the row, which reduce the height of the row. But the borders are still there.

Can I hide it completely for all output types with more conditional formatting?

Can you suggest a different way to structure the

/m
Re: Hide empty row in crosstab [message #639763 is a reply to message #639743] Wed, 17 November 2010 17:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,

Up the data settings in the Window->preferences->Report
Design->Preview-Data. Can you try to preview it in the WebViewer. Its
on the toolbar "View Report In Web Viewer". When I preview it the row
for Value5 does not show. You can also hide the cells by putting a
crosstab script on the crosstab similar to this:

function onCreateCell( cellInst, reportContext )
{
if( cellInst.getCellID() == 313 || cellInst.getCellID() == 316 ||
cellInst.getCellID() == 309){

if( cellInst.getDataValue("dim_Group2/dim") == null){
cellInst.getStyle().setDisplay("none");
}
}
}

I do notice some inconsistencies between the preview tab and the Web Viewer.

Jason

On 11/17/2010 11:16 AM, Marco wrote:
> Jason,
>
> Thanks for the sample. It seems to suffer from the same short coming.
> The line for Value5 is empty but still there if not omitted based on
> dimension value. Beside that I do not understand why it stops at this
> line when show empty rows is activated. Would you explain?
>
> Coming back to my requirement which should not be that uncommon. Imagine
> you want to report on various scenarios over a period. Each scenario is
> characterized by some attributes. Columns dimension is the time, row
> dimension is scenario, the measures are the attributes.
>
> Everything fine, but let's assume some attributes are not relevant or
> even not defined for certain scenarios. So the measure is empty and I
> want to omit it for that scenario.
>
> How can I omit that rows? Is there a workaround to hide the full rows. I
> can hide the text in the row, which reduce the height of the row. But
> the borders are still there.
>
> Can I hide it completely for all output types with more conditional
> formatting?
>
> Can you suggest a different way to structure the
> /m
Re: Hide empty row in crosstab [message #639900 is a reply to message #639763] Thu, 18 November 2010 10:54 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

You are right the issues with the missing lines in your example is just in the preview tab, not when viewed in browser.

I want to try your suggested script. But the Crosstab does not have a property onCreateCell.

I placed
this.getStyle().setDisplay("none");
into the onCreate property of Data, AggregationCell, Header, and the Cell of Header. But this does only have the same insufficient effect as a HideRule.

Thx
Marco
Re: Hide empty row in crosstab [message #639905 is a reply to message #639900] Thu, 18 November 2010 11:16 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

I found the way to enter the onCreateCell function. And this way it works.

Thanks a lot,
Marco
Re: Hide empty row in crosstab [message #640965 is a reply to message #639905] Tue, 23 November 2010 17:17 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Hi Jason,

The onCreateCell handle seems to be the right way. (or maybe onCreateRow?)

But I am missing the necessary data there to decide whether to hide or not. All I need is in the DesignHandle, and this actually is a property of it, but it is private without a getter.

How can I access the DesignHandle for the cellInst?

Thanks,
Marco
Re: Hide empty row in crosstab [message #640976 is a reply to message #640965] Tue, 23 November 2010 17:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,

What property are you trying to get? If its a design time property you
should be able to just use a visibility expression.

Jason

On 11/23/2010 12:17 PM, Marco wrote:
> Hi Jason,
>
> The onCreateCell handle seems to be the right way. (or maybe onCreateRow?)
>
> But I am missing the necessary data there to decide whether to hide or
> not. All I need is in the DesignHandle, and this actually is a property
> of it, but it is private without a getter.
>
> How can I access the DesignHandle for the cellInst?
>
> Thanks,
> Marco
>
Re: Hide empty row in crosstab [message #640998 is a reply to message #640976] Tue, 23 November 2010 19:37 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
I would to access like e.g. the AggregateOnRow to check generically whether this row is empty. Then I would not need to prepare a separate expression at design time but could do it dynamically in the onCreateCell script.

/m
Re: Hide empty row in crosstab [message #641144 is a reply to message #640998] Wed, 24 November 2010 12:23 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
And even more basic I need to get the measure to which a cell belongs.

My intention in detail:
get the measure name to identify the visibility expression to check.

I'd prefer to omit a visibility expression and put it directly in the script. So how could if something like:
if ((COUNT <measureName> ON RowDimension/RowDimensionGroup) == 0)
    setDisplay("none");

Re: Hide empty row in crosstab [message #641205 is a reply to message #641144] Wed, 24 November 2010 14:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,
Not sure this will help but:

While in the onCreate script of the crosstab you can check values for
the dimension or measures by doing one of two things.
You can call cellInst.getDataValue, which lets you get the value of any
of the fields on the binding tab for the crosstab at the time the cell
is created. For example:
if( cellInst.getDataValue("PRODUCTLINE") == "Planes" ){
In this example PRODUCTLINE has the expression in the binding tab
dimension["ProductGroup"]["PRODUCTLINE"]
You can also call
if( reportContext.evaluate("measure['amount']") == null ){
to get the value
You can check if you are in a header cell or aggregation cell by just
calling
if( cellInst.getCellType() == "header" )
or
if( cellInst.getCellType() == "aggregation")
or every cell has an id at design time so you can check it to
if( cellInst.getCellID() == 24){

To hide it you may try
cellInst.getStyel().display = "none"

Jason



On 11/24/2010 7:23 AM, Marco wrote:
> And even more basic I need to get the measure to which a cell belongs.
>
> My intention in detail:
> get the measure name to identify the visibility expression to check.
>
> I'd prefer to omit a visibility expression and put it directly in the
> script. So how could if something like:
>
> if ((COUNT <measureName> ON RowDimension/RowDimensionGroup) == 0)
> setDisplay("none");
>
>
Re: Hide empty row in crosstab [message #641236 is a reply to message #641205] Wed, 24 November 2010 15:36 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

This is already understood. But it does not help me to identify to which measure the current cell belongs.

Maybe we can do it the other way around. Can I get from context to which measureView a cell with the ID of cellInst.getCellID() belongs?

/m
Re: Hide empty row in crosstab [message #641248 is a reply to message #641236] Wed, 24 November 2010 15:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,

Do you mean a specific value of a measure or a design time measure?
For example If I have a sum and a count measure in my crosstab design,
they are contained within a cell with an id that I know and can use at
runtime to determine which measure the cell is for.

Jason

On 11/24/2010 10:37 AM, Marco wrote:
> Jason,
>
> This is already understood. But it does not help me to identify to which
> measure the current cell belongs.
>
> Maybe we can do it the other way around. Can I get from context to which
> measureView a cell with the ID of cellInst.getCellID() belongs?
>
> /m
Re: Hide empty row in crosstab [message #641256 is a reply to message #641248] Wed, 24 November 2010 16:22 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Jason,

The crosstab and the script is generated, and the design might then be changed by the user.

So I cannot rely on the assumption that the IDs are still the same at run-time.

Beside that, checking static IDs makes the script much more complicated because it has to check for each measure despite all measures should be treated the same except of the expression.

/m
Re: Hide empty row in crosstab [message #641342 is a reply to message #641256] Thu, 25 November 2010 06:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You could always name the data item that holds the measure and then in
the crosstab script do something like:

var measrueoneid =
reportContext.getDesignHandle().findElement("mymeasure1").getID();

Then use the id in the script.


Jason

On 11/24/2010 11:22 AM, Marco wrote:
> Jason,
>
> The crosstab and the script is generated, and the design might then be
> changed by the user.
>
> So I cannot rely on the assumption that the IDs are still the same at
> run-time.
>
> Beside that, checking static IDs makes the script much more complicated
> because it has to check for each measure despite all measures should be
> treated the same except of the expression.
>
> /m
Re: Hide empty row in crosstab [message #645869 is a reply to message #641342] Mon, 20 December 2010 21:07 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Hi Jason,

I achieved to dynamically hide rows with setDisplay("none").

The rows are completely gone in a html report on Linux. But in pdf there are still ugly and irritating artifacts left.

The same artifacts are show in html under windows, just narrower.

I have prepared small demo output in html and pdf. If you could tell me how, I would like to send it to you or publicize it.

Regards,
Marco
Re: Hide empty row in crosstab [message #645998 is a reply to message #645869] Tue, 21 December 2010 14:21 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Marco,

Can you email it to me at jasonweathersby at windstream dot net?

Jason

On 12/20/2010 4:07 PM, Marco wrote:
> Hi Jason,
>
> I achieved to dynamically hide rows with setDisplay("none").
>
> The rows are completely gone in a html report on Linux. But in pdf there
> are still ugly and irritating artifacts left.
>
> The same artifacts are show in html under windows, just narrower.
>
> I have prepared small demo output in html and pdf. If you could tell me
> how, I would like to send it to you or publicize it.
>
> Regards,
> Marco
Previous Topic:Iportal
Next Topic:logs cleanup - web viewer
Goto Forum:
  


Current Time: Wed Dec 17 21:30:40 GMT 2014

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

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