I have a report that has the amount deducted for health insurance in payroll and a subreport with the rates from human resources. Is it possible to highlight the field in the subreport if it doesn't equal the amount in the main report?
Place this in a section of the main report above the one containing the sub, e.g., if the sub is in GHb, place the formula in GHa. Then in the subreport, you can select the corresponding field->format field->borders->color->background->x+2 and enter:
whileprintingrecords;
shared currencyvar hrrate;
if currentfieldvalue <> hrrate then
cryellow else
crnocolor
You should add a reset formula in the main report, in a section after the subreport, e.g., GHc, which can be suppressed:
Variable in main report: Group Footer #3A
Sub located: Group Footer #3b
Subreport formula was entered on the rate field (PRBE.RateAmount) using the format editor > background> x+2 > formula
whileprintingrecords;
shared currencyvar hrrate;
if currentfieldvalue <> hrrate then
cryellow else
crnocolor
If you need to send a value to the sub report why not send it as a parameter on the sub report? It seems much more simple than messing with shared variables.
I got the highlighting to work now. Using the shared variable formulas.
I am now trying to get another highlighting value to work. I have 2 different rates. The weekly rate and the monthly rate. The report will be run on both a weekly basis and a monthly basis. I tried doing a datediff shared variable to count the number of days between the beginning payroll date and the ending payroll date. If the datediff is less than 28 don't no color else green. Formula:
whileprintingrecords;
shared currencyvar datediff;
if datediff < 28 then
crnocolor
else
whileprintingrecords;
shared currencyvar hrrate2;
if currentfieldvalue <> hrrate2 then
crgreen else
crnocolor
I must have something wrong in my formula because it doesn't work.
Where's the formula where you establish the datediff value? I don't really see what you are trying to do here--still coloring one field and checking the datediff formula for that row?
You should also change it to:
whileprintingrecords;
shared currencyvar datediff;
shared currencyvar hrrate2;
if datediff < 28 then
crnocolor else
if currentfieldvalue <> hrrate2 then
crgreen else
crnocolor
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.