|
Re: expand collapse rows and export to PDF [message #499117 is a reply to message #496651] |
Thu, 19 November 2009 22:55 |
Jim Messages: 19 Registered: July 2009 |
Junior Member |
|
|
The code below is an excerpt from the Expand Collapse Report Group example referred to in my first post. (A very nice example btw).
For my question, the situation is that the report has run and is being displayed in the Birt Viewer.
Here is my question:
In the code below, In the for loop that sets the display style, is there any way to set a row level variable that can be seen by the report row onRender event or by the row visibility property?
I am thinking that if I can set a variable that can be seen in either of these two places, I can set the visibility of the row when the report is exported to pdf.
Or, is it not possible to set a variable that is visible to the report from within script tags?
Thanks for any input on this.
The following code appears inside a text element on the Expand Collapse Report Group report example:
<form>
<script>
function hidetable(form, ord, rwcnt){
//alert( document.getElementById(ord).style.display );
var hide = false;
var btnstr = "mybutton"+ord;
if( document.getElementById(ord).style.display == 'block' ||
document.getElementById(ord).style.display == ""){
document.getElementById(ord).style.display = 'none';
document.getElementById(btnstr).value = "+";
//form.btnstr.value = "+";
hide = true;
testVar = -1;
}else{
document.getElementById(ord).style.display = 'block';
document.getElementById(btnstr).value = "-";
//form.btnstr.value = "-";
hide = false;
}
for( i=1; i<= rwcnt; i++ ){
var drow = ord+""+i;
if( document.getElementById(drow)){
if( hide ){
document.getElementById(drow).style.display = 'none';
}else{
document.getElementById(drow).style.display = 'block';
}
}
}
}
</script>
<INPUT Type="BUTTON"
name=<VALUE-OF>"mybutton"+row["ORDERNUMBER"]</VALUE-OF > Value="-"
onClick='hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>,
<VALUE-OF>row["Aggregation"]</VALUE-OF> )'></INPUT>
<VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>
<script>
hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>,
<VALUE-OF>row["Aggregation"]</VALUE-OF> );
</script>
</form>
|
|
|
Re: expand collapse rows and export to PDF [message #499295 is a reply to message #499117] |
Fri, 20 November 2009 17:10 |
|
Jim,
The problem is that approach for collapsing groups is done post render
and all on client side script. When you export to pdf it goes back to
the rptdocument and renders it, thus losing all the client side
interaction. One alternative may be to add a link to the report or
modify the export button to run a report that only shows the groups you
want. That way you could have a global js var set on the client side
that has all the groups you want to expose and you could use this in the
link to a new report. Just a thought.
Jason
Jim wrote:
> The code below is an excerpt from the Expand Collapse Report Group
> example referred to in my first post. (A very nice example btw).
>
> For my question, the situation is that the report has run and is being
> displayed in the Birt Viewer.
>
> Here is my question:
> In the code below, In the for loop that sets the display style, is there
> any way to set a row level variable that can be seen by the report row
> onRender event or by the row visibility property?
>
> I am thinking that if I can set a variable that can be seen in either of
> these two places, I can set the visibility of the row when the report is
> exported to pdf.
>
> Or, is it not possible to set a variable that is visible to the report
> from within script tags?
>
>
> Thanks for any input on this.
>
>
>
> The following code appears inside a text element on the Expand Collapse
> Report Group report example:
>
> <form>
> <script>
> function hidetable(form, ord, rwcnt){
>
> //alert( document.getElementById(ord).style.display );
>
>
> var hide = false;
> var btnstr = "mybutton"+ord;
>
> if( document.getElementById(ord).style.display == 'block' ||
> document.getElementById(ord).style.display == ""){
> document.getElementById(ord).style.display = 'none';
> document.getElementById(btnstr).value = "+";
> //form.btnstr.value = "+";
> hide = true;
> testVar = -1;
>
>
> }else{
> document.getElementById(ord).style.display = 'block';
> document.getElementById(btnstr).value = "-";
> //form.btnstr.value = "-";
> hide = false;
> }
> for( i=1; i<= rwcnt; i++ ){
> var drow = ord+""+i;
> if( document.getElementById(drow)){
> if( hide ){
> document.getElementById(drow).style.display = 'none';
>
> }else{
> document.getElementById(drow).style.display = 'block';
>
>
> }
> }
> }
>
>
>
> }
>
> </script>
>
> <INPUT Type="BUTTON"
> name=<VALUE-OF>"mybutton"+row["ORDERNUMBER"]</VALUE-OF > Value="-"
> onClick='hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>,
> <VALUE-OF>row["Aggregation"]</VALUE-OF> )'></INPUT>
> <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>
> <script>
> hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>,
> <VALUE-OF>row["Aggregation"]</VALUE-OF> );
> </script>
>
> </form>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03034 seconds