If you have let's say table with record and one of those records is a date field and you want to display them by "Period type" how would you do it?
Let's say I would take "Period Type" Month
January Record 1
January Record 2
January Record 3
February Record 4
February Record 5
...
and so on
If I have the Date dataitem filtered to show month, then each month has a Period Start and Period End. So under the dataitem Date I would add a G/L Entry Dataitem indented one level after the date rec. Then through the propertied of the Dataitem link or through code I would do:
Then in the body of the G/L Entry I would add the fields of the G/L Entry that I need and a textBox with SourceExpression Date.Name (or something similar)...
You can do that by using a Footer or Groupfooter section.
But with the Date dataitem it could be difficult since you cannot change the keys. In that case I would add a footer on the (for example) G/L Entry dataitem.
If I wanted to count I would print a "G/L Entry".Count in the section. If I wanted to add the Amount I would add a the amount in the totalfields property or in the Onpredataitem trigger I would do CurrReport.CREATETOTALS(Amount). Look up help for CREATETOTALS and Footers. It' easy to add automatic totals / subtotals that way...
Answers
Date."Period Start" is the value of the field in the current record.
Date.GETFILTER("Period Start") is the value the user entered on the request form.
If you need the filter at the beginning you should place the commend in the OnPreReport trigger...
If you have let's say table with record and one of those records is a date field and you want to display them by "Period type" how would you do it?
Let's say I would take "Period Type" Month
January Record 1
January Record 2
January Record 3
February Record 4
February Record 5
...
and so on
Example with G/L Entry:
If I have the Date dataitem filtered to show month, then each month has a Period Start and Period End. So under the dataitem Date I would add a G/L Entry Dataitem indented one level after the date rec. Then through the propertied of the Dataitem link or through code I would do:
"G/L Entry".SETRANGE("Posting Date",Date."Period Start",Date."Period End");
Then in the body of the G/L Entry I would add the fields of the G/L Entry that I need and a textBox with SourceExpression Date.Name (or something similar)...
Hope that helps...
If i want to group some data by months in a report like if i have a time period of
01.01.08 to 01.06.08
Jany 5 (invoices)
Feb 3
Mars 10
Apr 3
Mai 3
Jun 1
Is there a easy way to display the months in Nav or would I need to create manually create a month array.
But with the Date dataitem it could be difficult since you cannot change the keys. In that case I would add a footer on the (for example) G/L Entry dataitem.
If I wanted to count I would print a "G/L Entry".Count in the section. If I wanted to add the Amount I would add a the amount in the totalfields property or in the Onpredataitem trigger I would do CurrReport.CREATETOTALS(Amount). Look up help for CREATETOTALS and Footers. It' easy to add automatic totals / subtotals that way...