开发者

How to set MAXIMUM number of record in DETAIL SECTION in crystal report?

开发者 https://www.devze.com 2023-02-20 13:08 出处:网络
How to set MAXIMUM number of record in DETAIL SECTION in crystal report I am making Report which has Pre-Printed Format.

How to set MAXIMUM number of record in DETAIL SECTION in crystal report I am making Report which has Pre-Printed Format. Which allows Six Lines of row to be PRINTED. So in report if i get More then Six row in detail Section then it should be set on next page of report. Now say i get 8 rows in detail section then First Page with Six rows should be set & remaining 2 rows should be set on second page & 6 rows blank space should be automatically added in second pages detail section.

I have tried like : section expert for the detail section and against New Page After add the formula (x-2) recordnumber mod 6 = 0

But it only works when i just have to set Maximum row for Page but IT 开发者_运维知识库DO NOT ADD ANY BLACK ROW IF THERE ARE LESS ROW IN DETAIL SECTION but i want to add blank row.

Ex: Order Description Quantity

123 Item 1 500

124 Item 2 350





This is possible to do but it is a bit of hack. I'm pretty sure there is nothing built in to Crystal that will do this for you.

First you need to add a new formula field to your report in the Detail Section, with the following formula:

(RecordNumber Mod 6)

I have called this formula mod_record.

You then need to add 5 new sections below your main Detail section. Add a single line to each of the new sections you have just added.

In the first detail section (Details b) go to Section Expert and click the formula button next to Suppress (No Drill-Down). In the formula you need to put the following:

If OnLastRecord = true Then
  If {@Mod_Record} <= 1 Then 
      false 
  Else 
      true
Else
  true

The formula is the same for each detail section apart from one change. You need to replace the <= 1 with the following for each section:

  • Details c should be <=3
  • Details d should be <=4
  • Details e should be <=5
  • Details f should be <=6

This will give the impression that the details section is a fixed width of 6 lines.

Hope this helps.


Write following formula on new page after property of detail section

if recordnumber mod 5 = 0 then true else false


Barry's Example given above works perfectly... The only problem I had with it is that I was doing page breaks after a specified group. Since Barry's method was dependent on RecordNumber this threw the RecordNumber count off as their is currently no way to reset the RecordNumber on a page break.

I ended up resolving this by placing the detail section in a sub report off of the main report... this created a recordNumber reset as the RecordNumber resets with each sub report link change.

A lot of work to institute something that Crystal should have implemented by now... but I have researched this a lot and have not found an easier way to handle this.

0

精彩评论

暂无评论...
验证码 换一张
取 消