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

Combining the string fields.

Status
Not open for further replies.

prgmrcr

Programmer
May 11, 2009
56
US
Hello Forum,
I have a database and the data is like:

EmployeeName EmployeeID State Committee Salary
John Aldi 1 TX Action Committee 5000
John Aldi 1 TX Insurance Committee 5000
John Aldi 1 TX Non Profit Committee 5000
John Aldi 1 TX Political Committee 5000
Derek Youk 1 NJ XXXXX Committee 4500
Derek Youk 1 NJ YYYY Committee 4500
Derek Youk 1 NJ AAAAA Committee 4500
Derek Youk 1 NJ BBBBB Committee 4500

I can do the grouping on EmployeeID to get the data for each employee. The problem is I need to display the data in the report is like

EmployeeName EmployeeID State Salary
John Aldi 1 TX 5000
Action Committee
Insurance Committee
Non Profit Committee
Political Committee

Derek Youk 1 NJ 4500
XXXXX Committee
YYYY Committee
AAAAA Committee
BBBBB Committee

All the committees for each employee should be displayed in one text field. I tried using an array to combine all the committees for each employee and then place that text field in that group but I was not able to do it. I tried using sub report but because of large volume of data, It is taking really long time to display the report.

Can any one tell me the right way to do this ?

Thanks in Advance.
 
Do you want the layout as in your example concerning the committees? Or in one text field as you mention in your post?

Or are you thinking of one text field with each committee on a new line?
 
Do you really need the committees in one field, or do you just need to get the above display? You can do that by doing the following: Insert a group on the employee field, and place all fields except the committee field in the group header. Place the committee field in the detail section.

-LB
 
This report will be exported to excel.User is looking for the format i specified below.

EmployeeName EmployeeID State Salary
John Aldi 1 TX 5000
Action Committee
Insurance Committee
Non Profit Committee
Political Committee

Derek Youk 1 NJ 4500
XXXXX Committee
YYYY Committee
AAAAA Committee
BBBBB Committee

Is it possible by combining all the committees of each employee into one text field or place the committee field in detail section ?
I thought of combining all the committees for each employee in to one text field separated by comma (,).
 
Hi,
Use lbass's idea of Grouping and having the committees in the details...
RH
PH
GH Employeename EmployeeID State Salary
D Committee
GF
PF
RF

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I did that but when i export it to excel its not according to the expected output. Can we combine all those committees for each employee into one text field using arrays or any other concept?
 
Hi,
What issues does the export cause? I am not sure combining the committees in one field would solve anything but if you give an example of what happens maybe a way can be determined to get what you need..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If you combine the committees into one field, they will end up in only one cell, and I doubt that is what your users want. The quality of the export depends upon your alignment. Attach each field to guidelines on all edges, both horizontal and vertical, with no spaces between fields and no space above or below in each report section. Remove any extraneous guidelines. Then try the export again. I prefer the regular export (not data only) in most cases.

-LB
 
Hello lbass,
User is looking for all the committee names to be in once cell when exports to excel. if i place the committee field in detail section, each committee prints in various lines in excel. So that is the reason i thought of combining all the committees into once text field. I hope this information helps you out.

Thanks.


Employee Name State Salary
John TX 2500
XXXX committee;YYYYYcommittee;ZZZZZ committee (in one cell)
Derek NJ 3500
aaaa committee;bbbb committee;cccc committee
 
Then you have changed your requirements--that is not the display you originally showed us. It is important to be specific in your opening post. In this case, create three formulas:

//{@reset} to be placed in the group header (employee):
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {table.committee}+";";

//{@display} to be placed in the group footer:
whileprintingrecords;
stringvar x;
left(x,len(x)-1)

Then suppress the detail section.

-LB
 
lbass-

I was looking for this exactly. Thanks for helping me out regarding this. I really appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top