SAP Knowledge Base Article - Public

1308012 - To display all the groups by default for a database filed in the crystal reports even if the value is not present in the database.

Symptom

How to display all the groups by default for the year even if the value is not present in the database

Resolution

1.Create a crystal report using a database. 

2.Insert a Subreport1 in the report header and name it as Pim_Cls_Id.

3.Create a formula as,

FrlArraydesc:

WhilePrintingRecords;

Shared stringVar strDesc: = strDesc & {Sheet1_.PIM_SUPRCLS_DESC} & ";"

Place this formula in details section of the Subreport1.

4.Create another formula,

Frlstrarray:

WhilePrintingRecords;

Shared Stringvar strValid: = StrValid & totext ({Sheet1_.PIM_CLS_ID},"##") & ";"

Place the formula in details section of the Subreport1.

5.Suppress all the sections in the Subreport1.

6.In the page header of the main report, create a formula.

Formula1: FrlArraydesc

WhilePrintingRecords;

Shared stringVar strDesc;

Formula2: Frlstrdesc

WhilePrintingRecords;

Shared stringVar strValid;

7.Insert a group on year in the main report. Create another Subreport2, "Sub_Report_year" and place it in group header.

8.Link the main report and the Subreport2 with the formula, fisc_yr, frlArraydesc and frlstrdesc as parameters.

9.In the Subreport2, create a formula

Suprcls:

Whilereadingrecords;

Numbervar J: =J+1;

StringVar prm1;

If J<=20 then ( prm1:=split ({?Pm-@frlArraydesc},";")[J]; );

prm1

Place this formula in details section of Subreport2

10.Create a crosstab in Report footer of Subreport2 using MTH as column, FISC_YR and suprcls as the row and sales amount as the value.

11.Write a formula, to create a  fake group in main report.

Fakegroup:

While reading records;

true;

12.Now in the Subreport, we can view all the data, by using the horizontal slider.

Keywords

KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , How To

Product

SAP Crystal Reports XI R2