Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Details should extend 2nd page after 1st page fill Post Reply Post New Topic
Author Message
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Topic: Details should extend 2nd page after 1st page fill
    Posted: 20 Dec 2007 at 11:41am
Hello Everyone,
 
I have a report which has 30 data columns in detail section.  When first page fills with 20 columns of data the next page should display remaining 10 columns of data.  Is it possible..How? Unhappy
 
Thanks in advance
VK
 


Edited by newbie - 20 Dec 2007 at 11:43am
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 21 Dec 2007 at 6:02am
Hi VK,
 
Create a Main Report with 20 columns of data ,then create a subreport with 10 columns of data ,Place the subreport in the report footer of Main Report.
 
Go to Details section of Main Report right click select section expert 
 
click  the formula button for  suppress (no drilldown)
and enter
 
pagenumber > 1
 
This will suppress the remaining pages from Main Report and just print the first page of the main report with 20 columns of data..... but it will not print all the details i.e. all the records is it that what you want ????
 
and then it will print the remaining 10 columns of data ....
 
Hope that helps......
 
Cheers
Rahul
IP IP Logged
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Posted: 28 Dec 2007 at 12:48pm
Thanks for your reply Rahul.
 
You are almost near to my requirement. I want to display 20 columns data in 1st page and 10 columns data in 2nd page.  The third page should start first 20 columns remaining data, 4th page displays 10 columns data and goes on.
 
1st page
20 columns data    
2nd page
remaining 10 columns data
3rd page
continue with 20 columns data (if any)
4th page
continue with 10 columns data (if any)
..goes on 
....
 
Is it possible do this?
 
Thanks
VK
 
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 29 Dec 2007 at 3:40am

please follow the following steps.

1. create one more  section in details. now u will have detail a and detail b

2.create three formulas in main report
   1st formula field is  "initival"  (to declare variables) it contains below variable
        shared numbervar xx :=0;
    place this initval in page header and supress it. this will make the value  of  shared numbervar xx to 0 every time a new page is invoked.

now take one more forumula field "mreccnt" to count no of records printed in the page. the syntax would be as  below
   shared numbervar xx := shared numbervar xx + 1;
place the "mreccnt" in the details a section and supress it.

now the third formula  field "lreccnt" to count maximum record no printed.
the syntax is as follows
shared numbervar yy := shared numbervar yy + 1;

place the third formula field "lreccnt" also in details a section and supress it.

now in the details a section put the 20 columns which is to be printed.

now in section expert of details a do the following
check the option new page after and write the formula
{mreccnt} = 49 (this will allow the print only 49 records, if you want to print more records the put a value accordingly) and save it.

now in details b section do the following

add a sub report in detials b section, this subreport contains the remaining 10 columns
now edit the subreport and create the following 4 formulas.

the 1st formula is "subinitval" (to declare variable) it contains the following syntax
  shared numbervar subcnt :=0;

place this "subinitval" in the report header and supress it so that shared numbervar subcnt will be initated to 0

now create the second formula "subreccnt" the syntax is as follows
shared numbervar subcnt := shared numbervar subcnt + 1;

place this formula "subreccnt" in the details section of subreeport and supress it (this is will count the no of records printed)


now create third formula "endrc" the syntax is as follows
shared numbervar yy; (this brings the maximum record printed on each page in the main report)

now create fourth formula "strtrc" the syntax is as follows
{@endrc}- 49; (this is to print only 49 records is subreport also, if u want more records change the value accordingly, but both the value should be same in main and sub report)


place the formula "strtrc" and "endrc" in report header section of the subreport and supress it.


now go to section expert of the details section of subreport.
check the supress button and in the formula tab write the following formula
{@cnt} <={@strtrc} OR {@cnt} > {@endrc};

save it and ur done..

this exactly works ur requirement.
here are some more clarifications

for page 1 of main and subreport the values will be as follows

first in main report there would be 49 records printed for 20 columns.
the value of mrrecnt will be 49  (last record no)
the value of lrrecnt also will be 49. ((to dispaly only 49 records in main report)

these values are passed in the subreport
the value of endrc would be 49
the value of strtrc would be 0
in section expert the records satisfying the follwoing condition will be supressed
({@cnt} <=0 or {@cnt} > 49)

based on these values the data in details of subreport will be displayed and supressed.

for page 2 of main and subreport the values will be as follows

first in main report there would be next  49 records printed for 20 columns.
the value of mrrecnt will be  98 (last record no)
the value of lrrecnt also will be 49. (to dispaly only 49 records in main report)

these values are passed in the subreport
the value of endrc would be 98
the value of strtrc would be 49  (98-49)
in section expert the records satisfying the follwoing condition will be supressed
({@cnt} <=49 or {@cnt} > 98)

i hope i tried my best approach to solve your problem.please let me know if you  have any doubts Thumbs%20Up

Thanks
Savan
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.