Telling a group header on which database field to group by
I am generating my report using code, as defined in the programmer's manual. This is useful for us to have reports built this way. Our limitations with Rave has been its designer, which creating new reports.
However, I am working on a relatively simple report. It takes one stored procedure's results, but I still need to present it in a master-detail kind of way. One field in the result separates each group. But I cannot figure out how to tell FastReports to create another GroupHeader whenever this field changes. Right now, it just creates one header at the top, regardless if I create it as a Header, a GroupHeader or whatever.
Essentially, I am looking for something akin to RaveReports' GroupDataView and GroupKey.
Ah, apparently, I need to use Condition on the GroupHeader. However, I cannot figure out what name my dataset has within the report.
Edit: Setting the UserName apparently works.
Still, I keep getting this error when trying to format a DateTime element into a Date:
'Memo4: Error in expression 'FormatDateTime(<Fisk."SysTm">, "Short Date")': ')' expected'.
I have no idea what ')' expected is supposed to mean.
Thanks in advance.
However, I am working on a relatively simple report. It takes one stored procedure's results, but I still need to present it in a master-detail kind of way. One field in the result separates each group. But I cannot figure out how to tell FastReports to create another GroupHeader whenever this field changes. Right now, it just creates one header at the top, regardless if I create it as a Header, a GroupHeader or whatever.
Essentially, I am looking for something akin to RaveReports' GroupDataView and GroupKey.
Ah, apparently, I need to use Condition on the GroupHeader. However, I cannot figure out what name my dataset has within the report.
Edit: Setting the UserName apparently works.
Still, I keep getting this error when trying to format a DateTime element into a Date:
'Memo4: Error in expression 'FormatDateTime(<Fisk."SysTm">, "Short Date")': ')' expected'.
I have no idea what ')' expected is supposed to mean.
Thanks in advance.
Comments
Thank you, that worked excellent. It was actually for a Memo.Text, but still; great. What confuses me, however, is because your suggestion - which works - contradicts what it says in the manual (albeit for 4.0, but I suspected such a major change to a common function would be unusual); any manual I can obtain that is updated with these subjects?
I have a more difficult - unusual perhaps? - question. If a Memo's data is the same as it was in its previous occurrence, I want it to be invisible (Visible:=false), but visible once again the data changed. But it is also important for the data to reappear even if it the same as last time, but if a new GroupHeader has appeared.
e.g. An illustration:
I hope that make sense. I realised it made it more readable to have the dates disappear if they are the same, because it is implied.
Slightly unrelated; I also wonder about a highlight question. It's great that you can use conditioning for highlighting, like not <Line#> mod 2, however you may expect in this report, that after a group header, a highlighted row may appear, when this is undesirable. Essentially, after each group header's appearance, the condition should default to not highlighted and the highlight should continue the reverse. Is it possible to write an expression to ensure a highlight is based on whether the previous' row highlight was active?
For instance: Memo.Highlight.Condition := 'not ' + Memo.Name + '.Highlight.Active';
Then have the GroupHeader's OnAfterPrint be Memo.Name + '.Highlight.Active:=true'; or something.