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!

Detail fields into one detail line.

Status
Not open for further replies.

malka

Programmer
Jun 17, 2001
12
US
I am trying to create a fligth manifest, to combine arrival and departure flights on one line.
Both lines are detail lines in a foxpro table.
I have looked at Ken hamady's web solution and I was wondering if anyone tried his solution.
I have tested it on one field.
I have about 6 fields to combine with another line.
Do I need to create 3 formulas for each field - that is part of his solution.
And my second question is:
I do not have any grouping in my report. He instructs to put one of the formulas in the group header.
If you used his method, or if Ken Hamady can clear few things for me I will really appreciate all the help.
Thanks

 
I am using 2 foxpro 2.6 tables that are linked by an indexed fields (key). These tables are constantly used by another program that updates them.
One table has one detail line for each passenger and the other table has a detail line for each leg in a passenger itineary. I only need 2 flights for each pax even if the pax flew 12 segments. I need flights to specific cities that can be entered as parameters by the client. This has been done. And I have all the data correctly in the report, just that the client would like to see one line for each pax.
So basically I need to combine both legs of the itinerary.

Thanks.
 
Malka,

Is there any reason why you cannot create a group to use Ken's three part solution, and then supress the GH and Details. Since you are concatinating your field values it seems like your details section would be unnecessary and everything could be displayed in the footer? Chris
DFW Crystal User Group
 
If I understand you correctly, you specify the city and you want to show all arivals and departurs through that city. If they happen to be for the same person they should appear on the same line.

One other thing that I'm not clear on. If a passenger travels twice through the same city, is there anything which would link his arrival and departure as part of the same leg? If the passenger flies from DC to Pittsburgh to Cleveland on the 4th and returns Cleveland to Pittsburgh to DC on the 7th, and you are reporting on Pittsburgh, should this passenger have 1 or 2 detail lines. If it's one detail line, which arival and which departure should show up. If it's two detail lines, is there a code or field or something which would time one arrival to one departure?

I think if you can answer that, I can tell you a way to make this work.

oh, and how many records in the database? 100, 1000, 1000000?
 
Is there any reason why you cannot create a group to use Ken's three part solution, and then supress the GH and Details. Since you are concatinating your field values it seems like your details section would be unnecessary and everything could be displayed in the footer?
I can actually create a group and try Ken's solution. But if I understand correctly - do I need to create the 3 formulas for each field that appears on the second line.
In his 3 part solution - in the second part he instructs to put: String Var item:={YOUR.FIELD}//place your field in place of {YOUR FIELD}.
Right now I have
Lname Fname Arrdate Arrtm City Flt Depdate Deptm City flt
Smith Mark 7/19/2002 2:30P SFO US123
7/21/2002 5:30P SFO US34

It is not align here correctly but you get the idea.

Thanks for your help.
I am going to try the formulas.
 
Yes. You will need three formulas for each. The first sets or resets the string variable to "" when the group changes, the second concatonates the string fields together, and the third displays the result. Chris
DFW Crystal User Group
 
If you only have 2 lines of detail to display per line, just use the Next() function to get the value from the next record.

OR

Another approach is to build an array and then use Join() to display the results. It *may* present other challenges due to the 254 char limitation per formula, but you can use more than one formula...

OR

Consider doing this in Fox to a temp table and report off of it.

select 1
use thetable
scan
depart = (field)
skip
arriv = (field)
select 2
use mynewtable
append blan
repl (field1) with depart, (field2) with arriv,...
select 1
endscan

(Been a while since I touched xBase, but you get the idea)

-k kai@informeddatadecisions.com
 
Thanks you all for your help.
By trying Ken's solution I actually understood it.
And it is working so far. My fields probably will be longer than 254 char. But I will worry when I am done with writing all these formulas (3 for each fields).
I still have some questions but it is time to wrap it up and have a safe and happy 4th of July.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top