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

Extracting specific records (1, 5, 7, 13 and 22) 1

Status
Not open for further replies.

svennkjetil

Programmer
Feb 1, 2001
11
NO
Hi.

I have a table that looks like this:

Id Value
1 2.3
2 2.9
3 3.2
4 1.8
5 9.2
... and so on.

I want to print the value for id: 1, 5, 7, 13 and 22. How can I accomplish this?

Svenn Kjetil
 
put this in the Record Selection Formula

{Table.IDField} in ["1", "5", "7", "13", "22"]
 
Or use the select expert with the comparison of "One Of". Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thank you for the response!

I see that it is possible with version 8 to have multiple columns. Can I print the following layout:

ID 1: 2.3 ID 22: 9.3 ID 5: 3.8
ID 13: 4.2 ID 7: 2.2

Regards,
Svenn Kjetil
 
Use Format - Secton.
Highlight details.
The bottom check mark enables multiple columns.
The new tab that appears allows you to define size and flow of columns. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Yes, this will give me the layout. But can I accomplish the sort order?

Another matter: If I dont't have a record for ID 7 in the table, I still want to print "ID 7:" but with a blank value-field. Is this possible?

Thank you for the help.

Svenn Kjetil
 
What is your sort, I couldn't figure that out from your example?

Do you have ID 7 in a master table that includes all IDs?

What database format is your data stored in?
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I don't have a logical sort order. I want to extract those specific values and place them in a report in that obscure way...

Mayby I can do this in the Report header, by using 5 different SQL-statements?

I have the table in an Oracle database, and it has only two columns: ID and Value. The first contain a measurement-number 1, 2, 3 to 40. The second contain a measurement, e.g. temperature. As you see in the first text I posted.

Svenn Kjetil



 
You can't create a record if it doesn't exist. You CAN hard code these conditions in formulas that will print in the exact layout that you describe.

A conditonal formula would be like:

If {ID} = "7"
then {value}
else 0
(or else "" if a char field}

No do a grand total maximum of this column and print it wherever you like in the report header or footer. Do one pair (formula and max) for as many values as you like. This will print nothing if any ID doesn't exist and will allow you to arrange the values (in the report footer) however you like. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top