Crystal Reports: Showing only first record in each

2019-09-05 12:44发布

I searched to get the required answer but not found exactly what iam looking for - please help me.

Please follow the steps i made in crystal report:

Using crystal report command (i created a query to get the required business number) --> which gets 5 Business numbers

Note: Every business is having many receipt numbers (1st installment receipt, 2nd installment receipts... like that....) - these receipt details are stored in table_receipts.

In table_business - i have all details about business number, customer, product details...

Please understand the links:

table_business - table_customer - table_product - table_receipts

Relationship between tables are:

  • table_business.Bno=table_receipts.Bno
  • table_customer.Cno=table_customer.Cno
  • table_product.Pno=table_product.Pno

After creating the crystal report command; i just drag the required table in crystal report (table_business, table_customer,table_product,table_receipts)

Now i created a group for Business Number "BNo"

I need to display all the required details about that selected Business Number using parameter - its coming fine except receipts.

I mean its showing all receipts (all installment receipts). I need to display only the first receipt only (i.e: receipt number starst with letter "F" )

Hope you understand my requirement - Please help me in this regard.

Expecting your valuable reply. Regards, Sensa.

4条回答
趁早两清
2楼-- · 2019-09-05 13:33

I might have a solution for you.

1)Open the ‘Report’ menu then select ‘Section Expert’

2)Select the ‘Details’ section from the left hand menu

3)Tick the ‘Suppress No Drill-Down’ option and click on the icon to the right of it and in the formula option put

4)RecordNumber > 1

This should suppress the whole ROW/Record and not just the field. I saw your problem from this thread, I needed the exact same solution and this worked.

show only in the first row in crystal reports details section

查看更多
该账号已被封号
3楼-- · 2019-09-05 13:34

Here is what I tried for the same issue and it worked. It's a 2 step process involving using Running Total Fields and Suppressing in Section Expert.

First step is to create a Running Total Field (Right under Parameter Fields) Right click on it and click New and name your field i.e. CountFirstOnly On the left you will see the fields you can perform functions on.

Select the receipts field. Bring that over to field to summarize and select count.

Under Evaluate select For Each Record

Reset on Change of Group and select your grouping, in this case business number and click OK

Drag that field into your report.

Part 2: Section Expert

Bring up the section expert on details and click on the suppress X-2 button

Your formula should be: CountFirstOnly >1

Click OK

Refresh your report

Hopefully this did the trick.

查看更多
够拽才男人
4楼-- · 2019-09-05 13:34

It sounds as though the simplest way to meet this requirement would be to add a selection condition to the report - something like:

Left({table_receipts.Rno},1) = "F"

This should ensure that only the associated products and customers for the first receipt for each business are reported.

查看更多
仙女界的扛把子
5楼-- · 2019-09-05 13:35

You should be able to do this by creating a forumla for suppressing the field (table_receipts.Rno).

Right-click the {table_receipts.Rno} field and select Format Field...Common tab...Check the 'Suppress' box and then click the X-2 box to the right. When the new window appears paste this:

not ({table_receipts.Rno} startswith "F")

查看更多
登录 后发表回答