How to get a label from groupingfield on AdvancedDataGrid?

48 views
Skip to first unread message

Berkowitz - Fator13

unread,
Jan 30, 2009, 1:04:54 PM1/30/09
to Flex India Community
Hi!

I created the following application: http://i483.photobucket.com/albums/rr191/rafael_berkowitz/img.png
Now i need to export the ADG to EXCEL.
Already able to export, but the labels of the groups do not appear
(because I do not know how to get them! =]).
Ex: exporting the report of the image above I have the following
code:
<table>
<thead>
<th>Data / Faixa horária</th>
<th>VM B/C</th>
<th>VM C/B</th>
<th>B/C</th>
<th>C/B</th>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td>19.34</td>
<td>24.35</td>
</tr>
<tr>
<td>04:00</td>
<td>42.92</td>
<td>36.61</td>
<td></td>
<td></td>
</tr>
<tr>
<td>04:30</td>
<td>26.06</td>
<td>34.12</td>
<td></td>
<td></td>
</tr>
.....
</tbody>
</table>

Somebody help me please?
Thank's!

Berkowitz - Fator13

unread,
Feb 2, 2009, 7:47:05 AM2/2/09
to Flex India Community
Guys, can someone help me please? I could not solve this problem yet.

Thank you.


On 30 jan, 15:04, Berkowitz - Fator13 <rafael.rafael...@gmail.com>
wrote:

Berkowitz - Fator13

unread,
Feb 9, 2009, 7:08:03 AM2/9/09
to Flex India Community
Hello everybody. I still can not solve the problem. Can you give a
hand please?
Thanks!


On 2 fev, 09:47, Berkowitz - Fator13 <rafael.rafael...@gmail.com>

Sameer

unread,
Feb 10, 2009, 12:25:08 AM2/10/09
to Flex India Community
Set the Grouping.label property to the column's dataField in which you
are displaying the Group node -

<GroupingCollection>
<Grouping label="Column's dataField Name">
<GroupingField name="Name" />
<Grouping>
</GroupingCollection>

In your case it'll be the dataField for the first column with
headerText = "Data / Faixa horaria"

-Sameer

On Feb 9, 5:08 pm, Berkowitz - Fator13 <rafael.rafael...@gmail.com>

Berkowitz - Fator13

unread,
Feb 17, 2009, 3:03:58 PM2/17/09
to Flex India Community
The problem is that I dynamically create the GF:
---
var gfDataGravacao:GroupingField = new GroupingField();
gfDataGravacao.name = "data_gravacao";
gfDataGravacao.summaries=[sr];

if(!btTodosTrechos.selected) {
var gfReferencia:GroupingField = new GroupingField();
gfReferencia.name = "referencia";
gfReferencia.summaries=[sr];
group.fields = [gfDataGravacao,gfReferencia];
} else {
group.fields = [gfDataGravacao];
}
---
And the script to export to Excel:
---
if(!headerGenerated) {
header += "<th style='background-color: #"+headerColors[0].bg+";
color: #"+headerColors[0].txt+"; padding: 15px;'>&nbsp;";
header += column.headerText;
header += "</th>";
}
data += "<td x:num>"+ column.itemToLabel(obj).replace(".",",")
+"</td>";
---

I tested the way you said but could not.

Thank you!
> > > > Ex: exporting the report of theimageabove I have the following
Reply all
Reply to author
Forward
0 new messages