Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limit number of lines

Status
Not open for further replies.

audaweya

Programmer
Sep 7, 2006
5
MY
I want to display data from a subreport. The maximum record data that will display at the first page is only 4. If the data is more the 4, the first 4 data will display at the first page while the rest will display at the second page.
 
When you say "data from a subreport", do you mean subreport detail lines? Or shared variables returned to the main report.

Assuming it is subreport detail lines, then put a running total in the detail line. Make it a simple count. Suppress using a formula that checks the running total for being more than 4.

(Right-click on a section and choose Section Expert. Then choose the formula icon (x+2 and a pencil) for suppression. Enter a formula; e.g. @RecCount > 4 ).

Note that you have to use a running total: a summary total will have the final answer on the first line.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sounds like you need a page break after the first four records. Go to the section expert->new page after->x+2 and enter:

recordnumber = 4

If you are doing this within a group, then insert a running total {#cntwingrp} that counts all records within a group and then change the above formula to:

{#cntwingrp} = 4

This assumes that all other records within the group then fit on the second page.

-LB
 
thanks,
I am doing this within a group but the recordnumber = 4 formula is good. I don't know where can i find the {#cntwingrp}. I am using crystal report in visual studio 2005.

If i have two subreport in one page and both subreport max limit is 4 the remaining from both data will overlap. How can i fix.

 
YOu create the running total by going to the field explorer->running total->new. I just names it "cntwingrp". You would select any recurring field, count, evaluate for each record, reset on change of your group.

I don't know what your last issue is. If you have two subreports, if you place them in separate sections they will not overlap. For more help, you would have to describe your report layout in more detail.

-LB
 
Thank you for the respond but my team leader has change the format again. Actually I am doing license printing. Here how the license suppose to look like for the owner details. In the sub report it suppose to display the owner details.

Eg: Max line for printing is 3. Before exceed, print as follows:

Owner A (I/C no: xxxxxx-xx-xxxx)
Owner B (I/C no: xxxxxx-xx-xxxx)
Owner C (I/C no: xxxxxx-xx-xxxx)


Eg: If more than 3 names, adjust accordingly as follows:

Owner A (I/C no: xxxxxx-xx-xxxx), Owner B (I/C no: xxxxxx-xx-xxxx)
Owner C (I/C no: xxxxxx-xx-xxxx), Owner D (I/C no: xxxxxx-xx-xxxx)




1. System should determine how many lines available for printing.
2. System will then print the OWNER NAME in each line until it hits the max line for printing.
3. If too many, change the font size to make sure it fit into the max printing line area. The smallest font size can be used is 10.
4. If font size change 10, and it still exceeding the printing area, take out all OWNER NAME and move it to next page. It will display as follows

(List of Share Holders in enclosure)
 
I'd say you'll need to do a special preliminary subreport to find out how many owners there are. (Owners for a vehicle). Return the value as a shared variable, and line up the subreports accordingly. You'll need to do three versions of the details-displaying subreport, unfortunatley, two for the side-by-side and the other for one-of-three.

If you don't know about Shared Variables, do a SEARCH on this forum to get the details. Note the values from a subreport are only available in the next section.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
In the detail section, place the name field. In the group footer, place a subreport with the name field and format the detail section in the subreport to "format with multiple columns". Link the subreport on the group field. Then go to the section expert->detail->suppress->x+2 and enter:

distinctcount({table.name},{table.group}) > 3

Then format the group footer containing the subreport to suppress using this formula:

distinctcount({table.name},{table.group}) <= 3

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top