Crystal Reports

 

SQL Command: exec dbo.ProcGetLapsedWorkDays @startdate = '{?startdate}', @enddate = '{?enddate}'

 


 

getting a blank page output first when using grouping/ New Page before/after: suppress the report/page header

 


 

% operator divide by zero error stopping report output:

Percent operator

 Crystal syntax.

 

Usage

x % y

Calculates value x as a percentage of value y. That is (x/y) * 100.

 

Examples

 The following examples are applicable to Crystal syntax:

{file.BALANCE OUTSTANDING} % {file.CREDIT LIMIT}

Returns 30.00, where {file.BALANCE OUTSTANDING} = $1500 and {file.CREDIT LIMIT} = $5000.

{file.AMOUNT} % {file.CREDIT LIMIT}

Returns 32.26, where {file.AMOUNT} = 2257.87 and {file.CREDIT LIMIT} = 7000.

 Note:    If the denominator equals 0, the report will be halted with a divide by zero protection. If you want to avoid this type of problem, you should put a test in.

If {file.FORECAST} = 0 Then

     0

Else

     {file.SALES} % {file.FORECAST}

 


Suppressing Page Breaks:

Report -> Section Expert -> New Page Before -> [X2]:

IF OnFirstRecord THEN FALSE
ELSE
IF Previous ({@Month}) <> {@Month} THEN FALSE
ELSE
TRUE