Report on Date Ranges in different Years

Hi, I have been asked to create a report similar to 712 that will show sales quantities for two different years. To make things clearer, report 712 allows the user to enter a date range such as 01/10/05…31/10/05 which will show quanties for items sold within that date range but how can I code a report so that the report will also show quanties sold for the same date range but for the previous year. In other words an additional column would be added to the report making 2 sales qty columns that shows sales for 01/10/05…31/10/05 AND 01/10/04…31/10/04 seperately Is this possible. Thanks in anticipation.

What you could do is add a second dataitem “Item” and call it “Item2” (Name). Indent Item2 1 step right. Link the two dataitems using the property “DataItemLink”. This way you can fill 01/10/05…31/10/05 on Item and 01/10/04…31/10/04 on the second tab Item. Hide the bodysection of Item (currReport.showoutput(FALSE)) and from the bodysection of Item2 refer to Item. So two fields in the bodysection of Item2 for example: “Item.Amount” and “Item2.Amount”.

Excellent…Thanks Tino

Hi Tino, I get some really strange figures when I indent the second dataitem, in fact the report looks very wierd, why do I need to indent it. What will happen if they are both at the same indent level i,e not indented at all, how would it behave then. Thanks

If you don’t indent the second Item2, then both will run independendtly of one another, and it just wont work. In fact to make the report look correct, you will need to move all the design sections fromt he first itme to the second.

Thanks David for standing in for me! [;)] You’re doing a great job today on this site!

Thanks David I will do that and see if I can make it give me the correct figures. Like to stories on your website especially the cleaner unplugging the server, I had something similar happen to me 14 years ago on an IBM Mainframe while teaching people to use DBS Millennium software.

Hi David/Tino, The report is starting to come together now but could I please have a little more help to finish it off. This report is reading the Sales Invoice Line table (David is probably going to shout at me) with Sales Invoice Line2 as the indented dataitem. Both have a DataItemTableView of sorting on Item No. where Type is CONST of Item. I have defined GroupTotalFields to the Item No in both cases and the indented Sales Invoice Line2 has a DataitemLink of Item No. In the body of the report I have a Sales Invoice Line2 GroupFooter where I report on the quanties However when I run the report I am getting multiple lines for the same Item No. but I only want a single line per item showing the quanties. What am I doing wrong?? I hope I have supplied enough info for either of you to help me. Thanks

Paul, Not quite sure yet what’s going wrong. Maybe the answer is in the following post: If not, let us know.

Hi Tino, unfortunately that forum topic didnt help, any other thoughts?

I will leave this to Tino right now, but if you get stuck I will pop back into it. Basically you should be running this report from Item Ledger Entry or Value Entry.

Hi David/Tino, I have rewritten report to use the Item Ledger Entry table as per Davids advice in previous entry, I used the same properties as before ie. sorting both dataitems on Item No where Entry Type is CONST Sale both have GroupTotalFields of Item No., Item Ledger Entry2 (the indented dataitem) is linked to Item Ledger Entry (not indented) by Item No. and have run the report BUT get the same old problem, too many lines per item. I ran the Item Ledger Entry table and filtered on one item for the date range 01/12/05…31/12/05 and there are 7 entries. I then filtered on date range 01/01/06…31/01/06 and there were 6 entries. The output of my report should show 1 line with 2 totals, 1 that is the total of date range 01/12/05…31/12/05 and the other that is a total of date range 01/01/06…31/01/06 BUT it shows 7 lines. These 7 lines are each of the 7 entries in date range 01/12/05…31/12/05 with 7 different Quantities however the total for date range 01/01/06…31/01/06 is the total of all 6 entries added together BUT repeated 7 times. I hope this makes sense as I have tried to give as much information as possible without making it confusing.

Hi Tino, I have found the cause of my report problem. I was using Item Ledger Entry2 for the GroupFooter, changed it to Item Ledger Entry and it was perfectly. Thanks for both yours and Davids help with this one. Paul[:D]

Its generally just some tiny little thing. Glad its working.

Great! [:D] And your welcome.