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

One Line Formula With 2 Sets of Fields

Status
Not open for further replies.

Iris43

Programmer
Feb 25, 2003
8
US
I have a field with a 2 different question numbers and another field with corresponding values from these questions. By using a formula I can get the data to print in rows for each question, but I'd like it to print the values on one line, regardless of the question number.

I'm just starting out with Crystal Reports and I've looked at the post for one line formula. How can this work with 2 fields?

Any help is greatly appreciated!

 
Sorry, it seems hard to explain such a simple thing.

Here's more info:

The data lays out like this:

Field1 Field2
question1 Answer1
question2 Answer2

How I'd like to do this:

Question1 Answer1 Question2 Answer2

The 2 question numbers are in the one field, the 2 answer values are in the other field. I'm using an If, Then to pull out the individual question#'s and corresponding answers vertically, but really need the answers horizontally. Please let me know if you need more info

Thanks!
 
I'd use multiple columns.

click Format then choose Section, click on details and you should have 'Format with multiple columns' option. check this on and then click on the tab 'Layout' You can specify the siz of each column (large enough to contain you data) and choose 'accross then down'. Hope this is what you were after, enjoy! Reebo
Scotland (Going mad in the mist!)
 
Thank you Reebo! This looks good.

Is there a way to edit in the copied column?
 
Sorry, I've been awakw since 4am. What do you mean 'Is there a way to edit in the copied column?'. Reebo
Scotland (Going mad in the mist!)
 
I've just read your question again, and I think I know what you mean. The first column is the equivalent of the detail section. Any changes made on this column will effect all columns, however, you can change the look and feel of the content of each column by 'right click' on the field in question, goto font tab, click on x2 where you wish to change the properties. Then you can add something like (for Style change):

If field1 = "Question 2" then 1

This will make "Question 2" text appear in italics. If this is what you mean, have a play. Reebo
Scotland (Going mad in the mist!)
 
Reebo,

No problem. I understand.

I have other field that I need on the same line, and when I add the 2nd column in, they all duplicate into the new column and I can't move the duplicated fields right or left on the page. It's like their tacked down or in a different section that I can't edit.

I really appreciate your help. This has been plaguing me for months. I'll have some caffine for you.
 
I think I replied at the same time you did. Did you read my post above?

As I said, the first column controls which fields are displayed in all columns, the same as when you put fields in the detail section, it displays the fields for all records. Reebo
Scotland (Going mad in the mist!)
 
OK, give an example of how things look now, and how you wish things to look. I'll stay awake until we sort this out, so reply asap. [sleeping2] Reebo
Scotland (Going mad in the mist!)
 
Ok, I have fields:
1 2 3 4 5 and all are repeating a second time in the second column. I'm thinking I have to just live with this, but I'd like to only copy fields 4 and 5 a second time.

 
OK,

Column 1 Column 2
-------- --------
F1, F2, F3, F4, F5 F4, F5

What about the next columns?

If fields 1,2 and 3 contain the same information for all columns, can you group by one of these fields, insert fields 1,2 and 3 in the group header then only have 4 and 5 in the columns? Reebo
Scotland (Going mad in the mist!)
 
I shall try that.

Please don't stay up on my account. I've been evicted from my office for a bit. I'll let you know tomorrow.

Thanks!
 
Don't worry, I've got to stay up. I'm still at work and they frown upon sleeping at the desk. Reebo
Scotland (Going mad in the mist!)
 
Ok, here we are again. Nice to have my desk back without the fear of people falling through the ceiling near me.

When I inserted the group and put Fields 1-3 into the group header and left fields 4 and 5 in the details section and inserted the column, nothing printed in the new column.

I'm back to leaving it all in the details section and inserting the second column. I've "suppressed if duplicated", fields 1-3 so I have:

Column1 Column2
F1 F2 F3 F4 F5 F1-F3(suppressed) F4 F5

Doesn't look the best with all the space between the columns, but it works. Thoughts?
 
The group option should work if F1, F2 and F3 values were the same for both records. I've just tested this and it worked fine for me.

Otherwise, I can't think what else to suggest. Sorry it didn't work for you, but at least you got columns eh?[thumbsup2]

Reebo
Scotland (Going mad in the mist!)
 
Yes, I got the group option to work. I'll keep working on the columns and should have this sucker nailed today.

Thank you for getting me on the right path.

Take care,
Iris43
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top