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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to limit the values in output?

Status
Not open for further replies.

rajrev

Programmer
Sep 25, 2003
148
US
Hi,
We created a report, which was finished for unit testing. But the client request for new request, limiting the output value for some fileds.

Example.
Displaying the field called skill set in the main report like; Skill set => c, c++, java, vb...
For getting this output we are using a sub report (this suggesion was given by one of our discussion friend )
in subreport: Group by empid
and written 3 formulas
1.in Group Header (Suppressed)
whileprintingrecords;
global stringvar listskill :=" "

2. in Detail (Suppressed)
whileprintingrecords;
global stringvar listskill ;
listskill := listskill+{XX.Skill)+", "
and
3.in Group Footer
whileprintingrecords;
global stringvar listlang;
if (length(listskill) > 2 ) then
listskill :=left (listskill,length(listskill)-2)

Now we got the output as, Skill set => c, c++, java, vb... in main report. its working good.

What we need right now is to limit the values upto 3 in the list (ie) they only need the first 3 skill set
Skill set => c, c++, java. If there is any previous thread available please let me know or give your suggestion.
Thanks in advance.
Thanks,
MK

 
Add this to your current formulas :

1.in Group Header (Suppressed)
whileprintingrecords;
global stringvar listskill :=" ";
global numbervar Counter := 0;

2. in Detail (Suppressed)
whileprintingrecords;
global stringvar listskill ;
Counter := Counter + 1;
listskill := If Counter > 3 then listskill else
listskill+{XX.Skill)+", ";

Let me know how you get on.....

Reebo
UK

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."
- Albert Einstein (1879-1955)
 
Hi UK,
Thanks a lot for your help. Its working.
Thanks
MK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top