Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Crosstab
BregoXX
Hi all.
Designer create complex layout for report. See attach.
How i can create such report item?
Find more posts tagged with
Comments
bricombs
Good Day
You may want to take a look at the sample crosstab report as a starting point. It ships as part of our samples. I have included a link to the sample report and the top level link for all samples.
http://www.eclipse.org/birt/phoenix/examples/solution/crosstab.html
http://www.eclipse.org/birt/phoenix/examples/
You could also look at doing grouping in a report to get a report that looks like your screen shot. From your screen shot it is hard to know what you are showing for a value under the product.
BregoXX
Sorry for my English<br />
thanx for reply.<br />
I have found solution for create layout.<br />
In beforeFactory method i execute script.<br />
He crete header grid, and then for each product create grid with productName and grid with sale values to country for product.<br />
<blockquote class='ipsBlockquote' ><p>
importPackage(Packages.org.eclipse.birt.report.model.elements);<br />
importPackage (Packages.org.eclipse.birt.report.model.api);<br />
<br />
var grid = reportContext.getDesignHandle().findElement("anchorGrid");<br />
var cell = grid.getCell(0, 0);<br />
<br />
var seArray = new Array("Japan", "Germany", "USA");<br />
seArrayLength = seArray.length;<br />
<br />
var headerGrid = reportContext.getDesignHandle().getElementFactory().newGridItem("headerGrid", seArrayLength, 1);<br />
<br />
for(i = 0; i < seArrayLength; i++) {<br />
var headerCell = headerGrid.getCell(1, i + 1);<br />
var headerLabel = reportContext.getDesignHandle().getElementFactory().newLabel(seArray
);<br />
headerLabel.setText(seArray
);<br />
headerCell.getContent().add(headerLabel);<br />
}<br />
<br />
cell.getContent().add(headerGrid);<br />
<br />
var array = new Array(1,2,3,4,5,6,7,8);<br />
var length = array.length;<br />
<br />
for(i = 0; i < length; i++) {<br />
var grid = reportContext.getDesignHandle().getElementFactory().newGridItem("grid" + 1, 1, 1);<br />
gridCell = grid.getCell(1,1);<br />
<br />
var label = reportContext.getDesignHandle().getElementFactory().newLabel("label" + i);<br />
label.setText("productName" + i);<br />
gridCell.getContent().add(label);<br />
<br />
cell.getContent().add(grid);<br />
<br />
var valueGrid = reportContext.getDesignHandle().getElementFactory().newGridItem("name" + i, seArrayLength, 1); <br />
for(j = 0; j < seArrayLength; j++) {<br />
var valueCell = valueGrid.getCell(1, j + 1);<br />
var value = reportContext.getDesignHandle().getElementFactory().newLabel("value" + j);<br />
value.setText(Math.round(Math.random() * 1000));<br />
valueCell.getContent().add(value);<br />
} <br />
<br />
cell.getContent().add(valueGrid);<br />
}<br /></p></blockquote>
<br />
But, i don`t know how create header with country names on each page if i have page break..
bricombs
Good Day
If the standard crosstab does not provide you with the formatting that you are needing you could look at using a table instead of a grid. The header rows in a table will repeat on a page break. If you don't want to script everything for a table you could look at creating a scripted data source to bind to a table. This way you only need to create the data so that it is structured to show in the table the way you want it.