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!

Same database makes field repeat on Detail Line

Status
Not open for further replies.

dandman71

MIS
Aug 14, 2002
14
US
I am creating a report that I need to create seperate 'columns' for.
example. I create a formula field that returns a value, call it value 1
I then create a formula field that returns a value, call it value 2. Now, I place them next to each other in the report, but it shows one one one line, the other below, like this..

name
value1
value2

How can I have both of the values print on the detail line next to each other. If I place it on a header, it will not select the correct record. Can you help???LOL
 
Does formula1 evaluate for one record and formula2 for another? What do the formulas calculate? What does the data schema look like?

Lisa
 
2 databases. One holds employee info, the other benefit info.
In the second database there is a field I want to pull for a particular employee benefit. Instead of them printing one on top of another however, I want them to print side by side. So I have created 2 formula fields

field 1 IF (benefit)="XXX" then (coverage) else 0.
field 2 IF (benefit)="AAA" then (coverage) else 0

This returns the correct amount.However, it is adding a new detail line and not placing them next to each other when I preview.

 
I am having a similar problem with the details falling on two lines instead of one. I have entered both fields on the same line in the details section, but when I preview the report, there are two details lines, one for each field. My fields are not formulas in the report, they are fields, but they are created in the stored procedure based on data types. Anyone have a suggestion?
 
a little more detail...

In the details section I have:

{ProjNum} {ProjMgr} {Hours1} {Hours2}

The report shows:

ProjNum ProjMgr Hours1 Hours2
1111 Joe S. 40
1111 Joe S. 70

I want it to show:
ProjNum ProjMgr Hours1 Hours2
1111 Joe S. 40 70


Hours1 is created in the stored procedure when a datatype equals a certain number, Hours2 when the datatype equals another number.
 
ddnh:

Your problem is that the stored proc is actually returning two rows..

You can either a) change the stored proc so that it groups by projNum, ProjMgr and sums Hours1 and Hours2 or
b) group in Crystal and only show the group lines (suppress detail) and essentially do the same as a) in crystal

dandman71:

Since value1 and value2 come from different databases, you too probably have the same problem as ddh.. its harder to tell without knowing what your links are.., I have gotten some REALLY strange results mixing db's.. it is supposed to work.. and sometimes really does.. you just can't get too complicated (try server1 -> server2 ->server1 links if you want to see something pretty close to impossible)

Lisa

 
If for some reason you can't use a group header to align information, try adding an alias of the table that has the competing fields. Don't link the alias to its counterpart, but instead create a link from a third table to the alias, e.g.,:

Main ------>Table 1
v
Table 2

Use Table1 for the first field, and Table 2 for the second, and add the criteria for each field to your select statement or create a formula using your criteria to define each field:

if {field1} = yourcriterion then {field1}

if {field2} = yourcriterion then {field2}

After adding the fields to your detail section, go to format section and add the following formula to the detail section-> suppress->E-2 button formula:

If not onfirstrecord then
{field1} = previous({field1}) or
{field2} = previous ({field2}) //or if you created formulas for each field,substitute them for the fields in this formula


-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top