The standard sales statistics report when selected the date 01-01-2015 ect. have a column for 'before', '01-01-15 - 31-01-15', '01-02-15 - 28-01-15', '01-03-15 - 31-03-15', 'After'.
I want to make it continue to show all the following 12 months. I know you can extend the periods range so it shows for a period of 3 months, but thats not what i want.
I have tired to change the following code and inserting the fields and the layout, but i had trouble running the report because of a error.
OnPreReport()
CustFilter := Customer.GETFILTERS; FOR i := 2 TO 4 DO PeriodStartDate[i + 1] := CALCDATE(PeriodLength,PeriodStartDate[i]); PeriodStartDate[6] := 31129999D;
How should i change the code in report 112 to be able to show more date periods than the 3 from standard?
Thanks in advance.
*This post is locked for comments
Thanks alot Vishal! That was just what i needed to make it work.
Have you increased the Dimensions for all the fields....
Currently it is 5. You should increase the same, as per your need.
Hi Vishal,
I get the error "Index out of bounds."
What i have tried to do is changeing the code in OnPreReport.
Changing the PeriodStartDate[6] to [14].
OnAfterGetRecord() trigger - to filter more values. I have changed it from 1-5 to 1-13.
So it would look like this
OnPreReport() CustFilter := Customer.GETFILTERS; FOR i := 2 TO 10 DO PeriodStartDate[i + 1] := CALCDATE(PeriodLength,PeriodStartDate[i]); PeriodStartDate[14] := 31129999D; OnPostReport() Customer - OnPreDataItem() CurrReport.CREATETOTALS( CustSalesLCY,CustProfitLCY,AdjmtCostLCY,AdjCustProfitLCY, CustInvDiscAmountLCY,CustPaymentDiscLCY,CustPaymentDiscTolLCY,CustPaymentTolLCY); Customer - OnAfterGetRecord() PrintCust := FALSE; FOR i := 2 TO 13 DO BEGIN
...
Then in the dataset designer i have made more fields - periodStartDate6-12 and same with other fields.
Hi,
You need to change the code in OnPreReport trigger to define the right periodstartdate
and
Customer - OnAfterGetRecord() trigger - to filter the right values. As of now, it is generating for 5 arrays. You can run the For loop as needed.
Increase the dimensions array for all the fields.
What is the error that you are getting currently?
Hope this helps.
Sohail Ahmed
2
mmv
2
Amol Salvi
2