"Print On Change Only" in Grid

Rauf

Rauf

VIP Member
\"Print On Change Only\" in Grid

Is the feature "Print On Change Only" of RDA available for Grid in FDA. Or how can I code the grid to show the column value only if it changes.
So the input grid is,
<font class="small">Code:</font><hr /><pre>
Id Name Code Rate
1 Rauf AH 50
1 Rauf KU 10
1 Rauf PL 90
5 Amin FG 90
5 Amin TY 70
</pre><hr />

Output grid
<font class="small">Code:</font><hr /><pre>
Id Name Code Rate
1 Rauf AH 50
KU 10
PL 90
5 Amin FG 90
TY 70
</pre><hr />
 
Re: \"Print On Change Only\" in Grid

Can't remember having seen an option like that in FDA. So looks like you'll have to write ER. In general, you put Level Break processing ER in events Grid Record Is Fetched and Last Grid Rec Has Been Read. In your specific case, I think you can use event Write Grid Line Before to achieve what you want.
 
Re: \"Print On Change Only\" in Grid

No this is not available in FDA. You will have to code your own ER for this. Not easy but not impossible.

Chan
 
Re: \"Print On Change Only\" in Grid

OK. My idea is to compare the current column value with the previous column value. But how to get the previous column value, as there is nothing available like PC(Previous Column) ?
 
Re: \"Print On Change Only\" in Grid

Store the current BC in a variable = say PreviousColVal, and then verify it against the BC further on.
 
Re: \"Print On Change Only\" in Grid

[ QUOTE ]
OK. My idea is to compare the current column value with the previous column value. But how to get the previous column value, as there is nothing available like PC(Previous Column) ?

[/ QUOTE ]

That's part of the Level Break processing ER I mentioned in my previous post: You need to save those "Previous" values in VA-variables. PS: Make sure to set the Grid sort order correctly, and have your Level Break processing ER correspond to the Grid sort order.
 
Re: \"Print On Change Only\" in Grid

Hello Rauf,

You can use GB variables (Grid Buffer) as PC (Previous Column).

BR,


Luis.
 
Re: \"Print On Change Only\" in Grid

Hello Dears,
I have done it
smile.gif

Please see the code;
<font class="small">Code:</font><hr /><pre>
=======================================================================
FORM: Group Info and Details [HEADERLESS DETAIL] (W59HR10GD)
=======================================================================
CONTROL: FORM
EVENT: Post Dialog is Initialized
-----------------------------------------------------------------------
0001 // put Level Break processing ER in Grid Record Is Fetched
0002 VA frm_PreviousAddressNumber = BC Address (F59HR10B) Number

-----------------------------------------------------------------------
EVENT: Write Grid Line-Before
-----------------------------------------------------------------------
0001 If VA frm_PreviousAddressNumber is equal to BC Address (F59HR10B) Number
0002 // Set the column values to NULL
0003 GC AddressNumber = ""
0004 Else
0005 VA frm_PreviousAddressNumber = BC Address (F59HR10B) Number
0006 End If

-----------------------------------------------------------------------
EVENT: Variable
-----------------------------------------------------------------------
frm_PreviousAddressNumber
</pre><hr />
 
Re: \"Print On Change Only\" in Grid

Yeah, something like that. Except for Post Dialog Is Init: Your grid records are not read from db until *after* that event, so working with BC-values of grid records in that event makes no sense imo. Changing/moving that ER will probably require you to use a 'Is First Record' flag as well, analyse that. Although in your particluar case, setting that VA variable to 0 in Post Dialog Is Init will suffice imo. And oh yeah: Since this is a headerless detail, I think you need to disable Next Numbering for your AN8 column as well
tongue.gif
 
Back
Top