Decoding

Some Crystal Report Engine functions return section codes. These values can be decoded using one of three macros:

Each macro accepts an encoded section code as a parameter.

In the following example, you determine the number of sections in the report (using PEGetNSections), obtain the section code for each section (using PEGetSectionCode), and then decode the section code using the PE_SECTION_TYPE, PE_GROUP_N, and PE_SECTION_N macros.

numSections = PEGetNSections(job);
for (i = 0;i < numSections;i++)
{
    code = PEGetSectionCode(job, loopSectionN);
    areaType = PE_SECTION_TYPE(code);
    groupN = PE_GROUP_N(code);
    sectionN = PE_SECTION_N(code);

    // Perform section specific code here
}

Once you've identified the area, group, and section you want, you can then set the section format using code similar to this:

PESetSectionFormat(job, code, &mySectionOptions);

Note:    Earlier versions of Crystal Reports used different section code constants. Those constants have been remapped to the new section code format so reports created with earlier versions of Crystal Reports can run with applications created with the current version.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com