Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 389
  • Last Modified:

How to convert a non-null and not duplicate values from a field in details section into comma-separated formula field at Page header

Hi Experts,
I have multiple records in  a crystal report 11  and of all those records I need to display the result of one field as a comma separated value in the page header.
so if record goes like this in detail section  1   f1
                                                                    2   f1
                                                                    3   ""
                                                                    4   f2
                                                                    5   f1
                                                                    6   f3

then I should display
                              f1,f2,f3
 as a value in the page header. I need to avoid duplicates and empty string value.

Any hint/help would be greatly appreciated.

Thanks
0
NoorFaz
Asked:
NoorFaz
  • 5
  • 3
  • 2
2 Solutions
 
mlmccCommented:
To display it in the page header you will have to use a subreport.  I don't know of a summary function that will do what you want.

mlmcc
0
 
vastoCommented:
Yeah, I agree subreport will be the only way to show this in the page header.
You can handle this on the database side too . What is your database type ?
0
 
NoorFazAuthor Commented:
Any other possible way beside sub-report? Is there a way I could built an array whilereadingrecords and display that value on header.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mlmccCommented:
From what I have read and my experience is that variables only maintain values in the printing pass.

mlmcc
0
 
vastoCommented:
NoorFaz, as I said , you can handle this on database side. What is your database type?
0
 
mlmccCommented:
Are you trying to show for the whole report or just that page?

mlmcc
0
 
NoorFazAuthor Commented:
I wanted to show it for the whole report; I have the following calculated field which is only displaying the first vlaue although When I browse field data on this calculated field it shows set of values like f1;f1,f2;and f1,f2,f3 but its just displaying f1. How can I get hold of last value in this browse list.


whilereadingrecords;
 StringVar ConCat;

if isnull({table.Part}) = false and {table.Part} <> "" then

   ConCat:= ConCat + Trim({table.Part}) + ",";



Left(conCat,Length(ConCat) -1)
0
 
mlmccCommented:
As it finds them it adds the next value.  However the WhilePrintingRecords forces evaluation to the final pass.  The ony value it has in the page header is the first one.  If you put that in the report footer it will probably show the full string assuming the field is large enough.

mlmcc
0
 
NoorFazAuthor Commented:
It is showing right result at the end but not at the page header. Please help.
0
 
mlmccCommented:
That is the way the formula is supposed to work.  It will not be correct until it prints the last record.

Thus the suggestion to use a subreport

mlmcc
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now