Print Page | Close Window

Record Selection Formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22328
Printed Date: 02 May 2024 at 6:38am


Topic: Record Selection Formula
Posted By: Teddy555
Subject: Record Selection Formula
Date Posted: 07 Jun 2017 at 4:57am
Good day , I have a requested report to build .
The requested report is a sales history report showing item category , Item number and last but not least sales totals. It was very easy to get the data for 1 month using the select expert and a parameter i created which is : if (tablename.Year)={?Year} and (tablename.Period)={?Period) then (tablename.sales)-(Tablename.returns) else 0. The formula above worked except i need to get the same information for the following month and the month after as well. Then I also need the same information for the Previous year same periods. Can anyone help me please .

Regards,
Teddy
T.Calderon

-------------
T.Calderon



Replies:
Posted By: kevlray
Date Posted: 07 Jun 2017 at 5:55am
Sounds like you will need a couple of sub-reports with the other date ranges.  There are a few ways to get previous month date range (hopefully starting at the beginning of month and ending at the end of the month).


Posted By: Teddy555
Date Posted: 07 Jun 2017 at 6:15am
I was actually considering that, however i would need variances from the current year and periods compared to the previous year same periods . It is possible to subtract figures from two different reports right ?



Regards,
Teddy

-------------
T.Calderon


Posted By: Teddy555
Date Posted: 07 Jun 2017 at 7:54am
subreport seems to work however , the spacing is very bad . one record is being displayed from my main report and all records from the sub are being showed.



-Teddy

-------------
T.Calderon


Posted By: kevlray
Date Posted: 07 Jun 2017 at 9:11am
You did not mention which section you put the sub-report.  Normally I try to put sub-reports in a report footer. 


Posted By: Teddy555
Date Posted: 07 Jun 2017 at 9:27am
Ok , i will do so and Update you .

-------------
T.Calderon


Posted By: Teddy555
Date Posted: 08 Jun 2017 at 5:11am
That method Doesnt work , and the subreports are placed in the group footer of the report.

-------------
T.Calderon


Posted By: kevlray
Date Posted: 08 Jun 2017 at 6:40am
So you should have some records in the detail, then in the Group Footer, then sub-report should run.  Not sure what kind of spacing issues you would be having.  You should be able to collapse/hide sections.  Any text boxes can be set to grow, thus they can start small then automatically grow to final size.


Posted By: Flyfisher
Date Posted: 09 Jun 2017 at 7:52am
I'd do all one report with date parameters based on the invoice date.
Then use running totals for your yearly totals.


Posted By: Teddy555
Date Posted: 20 Jun 2017 at 4:58am
I was able to accomplish the report by setting parameters to work with formulas. E.G , to get the data for 1 month , my formula would be " if {?Period}={Table.Period} and {?Year}={Table.YR} then (rest of formula) this would pull the data for the period selected in the paramaters. Also to get the name of the month , i just created another simple formula to say " if {table.Period}=4 then " January " .

The report was rather easy to design , just had to think a little harder and i got it done.

-------------
T.Calderon



Print Page | Close Window