cancel
Showing results for 
Search instead for 
Did you mean: 

multiple paged report

Former Member
0 Kudos

Hi, I am somehow new to SAP CR for VS2010 and I am trying to create a report that is divided in 3 pages with data in each page related to the previous page. How can i create a multiple paged report? What i want to do is something like this.

======will be printed in page 1==========            =======will be printed in page 2====             ===========will be printed in page 3=====

Rec no. Employee name EmpID Gross income   |      Basic Salary    Bonus  Compensation     |          Exemption code      Tax withheld      Tax due

1            Peter parker      0001      $5,0000         |         $450               $200        $2.50           |                M1                           $50              $60

2            Emma stone   0002      $15,000           |         $500                $350       $10              |                S3                            $80              $55

this is just a sample data/field needed in each page. I tried using section expert and inserted another section under details but it does not give me what i want. TIA.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This is a better view of what i want to see in my report

former_member188030
Active Contributor
0 Kudos

Hi Hideki,

I would not suggest using CR for VS 2010 bundled designer for designing report. The designer should be used for sampling or testing reports. You could use any stand alone CR designer, CR 2008, 2011, 2013 to design your reports. See the trial versions here: http://www.sap.com/solution/sme/software/free-trials.html

With report design queries Abhilash Kumar might help.

Thanks,

Bhushan

DellSC
Active Contributor
0 Kudos

You're on the right track with the additional sections.  What you need to do now is open up the Section Expert (right-click in the gray area to the left of one of the details section and select "Section Expert").  Then turn on "New Page After" for each of the details sections to force each of them to a new page.

-Dell

Former Member
0 Kudos

Hi, thanks for the reply. I applied what u did and what happened is that it only shows the very first record on the page 1 and the second section related to the first record on page 2. It does not populate all the record on 'Details section a'. I attached the preview of what happened.

as you can see from the image there is only 1 record on page 1(Details section a) and 1 record in page 2(Details section b), where page 1 should have 10 records as well as page 2

DellSC
Active Contributor
0 Kudos

Ok, you're probably going to have to use subreports for this.  Will your report ever have more than the three specified pages (in other words, will the three pages repeat?)

-Dell

Former Member
0 Kudos

Hi, Sorry for a late reply because i took a day off. Yeah there is a chance that those 3 pages will repeat depending on the number of records to be displayed. So what will happen is that the data on page 1 will continue on page 4 and so on. Is this a case of using a sub-report instead of detail section?

Regards,

Hideki

DellSC
Active Contributor
0 Kudos

Yes, but this is going to be a bit tricky.

1.  Create a formula called "InitPage":

     NumberVar page = 1;

     Place this formula in the report header - it won't display because of the final ";"

2.  Create another formula called "SetPage":

    

     NumberVar page;

     if page = 3 then page := 1

     else page := page + 1;

     Place this formula in the page footer.

3.  Create a formula called "InitRows": (NOTE:  This assumes that your data for each row is using a numeric ID as the key)

     Global NumberVar Array rowInfo := [-1];

     1;  //formulas cannot return an array, so we give it a meaningless value to return

     Place this formula in the report header.

4.  Create a formula called "ClearRows":

     EvaluateAfter({@SetPage});

     Global NumberVar Array rowInfo;

     NumberVar page;

     if page = 1 then

     (

          Redim rowInfo[1];

          rowInfo[1] := -1;

     );

     1;

     Place this in the page footer below the {@SetPage} formula.

5.  Create a formula called "SetRow":

     Global NumberVar Array rowInfo;

     NumberVar page;

     if page = 1 then

     (

          if not ({MyTable.ID} in rowInfo) then

          (

              if rowInfo[1] = -1 then

                    rowInfo[1] := {MyTable.ID}

              else

              (

                   //Add one element to the array.

                   Redim Preserve rowInfo[UBound(rowInfo) + 1];

                   //Set the element to the value you need for linking the data.

                   rowInfo[UBound(rowInfo)] := {MyTable.ID}

               )

          )

     );

     1;

     Place this formula in your details section - it won't show anything, but it will set up the array for use in the subreports.

6.  Keep your subreports in the details sections as they are.

7.  In the Section Expert, do the following:

     a.  Turn off "New Page After" on the first details section.

     b.  For the second details section, set the Suppress formula to:

               NumberVar page;

               page <> 2

     c.  For the third details section, set the Suppress formula to:

               NumberVar page;

               page < 3

7.  In your subreport, create a Formula called "FilterArray":

     Global NumberVar Array rowInfo

     Note that there is NO semi-colon on the end of this!

8.  In the Select Expert, edit the selection formula to add something like this:

     {MyTable.ID} in {@FilterArray}

I haven't tested any of this other than to make sure that Crystal will verify the formulas.  But, it should get you close to what you're looking for.

-Dell

Answers (0)