Hello,
I have a Datafield as a DateTime in my Database and a function CalendarWeek
(DT: DateTime) which returns a Integer (the calendar week). Now I want to
group by the calendar week, but it doesn' t work.
what could be the problem?
Regards Manuel Neubauer
Comments
The ReportBuilder QueryDesigner does not allow grouping by a calculated
field due to the fact that this is not supported by all SQL engines. You
will need to manually edit your SQL code in order to group by a calculated
field from DADE.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I'm unclear about your question. Please give me more information about
exactly what you are trying to accomplish and which features of
ReportBuilder you are using. Also, please define which version of
ReportBuilder and Delphi you are using when asking a new question.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Version 10.06
I have a Date in my Database and a function which calculates the Calendar
week for each Date.
Group Header [Variable]
----------------------------------------------
Variable [getCalendarWeek (DB.Date)] (I want to group by this
function)
Detail
----------------------------------------------
Group Footer [Variable]
----------------------------------------------
Output
Calendar Week 28 ....
....
....
Calendar Week 29 .....
.....
.....
is that the OnCalc event fires too late for the group to pick up a change.
If you were to change the value before the DetailBand prints, the group
would break as expected. Although we do not usually recommend making
calculations outside a TppVariable.OnCalc event, I would suggest trying this
and seeing if it gives you the correct effect. If not, you may need to
re-design your dataset so you are able to group by the calendar week in your
dataset, rather than a custom field.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
the grouping also doesn?t work.
Have you got any Example how to use the 'userdefined grouping' function?
What is the function to group by a variable for, if it doesn?t work?
Regards
Manuel Neubauer
engine, you need to use either the Group.OnGetBreakValue event or the
Variable.OnGetText event.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Dataset...
- for the Query, add an Order By caluse that sorts the data by the grouping
field. RB will not do that for you.
- the report engine will traverse the datapipeline to which it is assigned.
Group.OnGetBreakValue gets called quite frequently - it is called by any
code that need to check the value fo the group.
- when the report engine detects that the group value has changed then it
will generate a group break.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
CalendarWeek 9 - 9 - 9 - 10 - 10- 12 - 13 - 13 -13 - 13 ... and the report
builder prints the group header only at the page header.
I also looked at the OnGetBreakValue and there are correct values in!
Regards,
Manuel Neubauer
There are no known issues with groups. If you would like to create a simple,
focused example, please use standard Delphi components and RB. Use the
DBDemos data or dump some of your data out to TClientDataSet. Send in zip
format to support@digital-metaphors.com. Please create a simple example, and
please do not send your actual report.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com