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

showing details in columns

Status
Not open for further replies.

aker

Programmer
Mar 27, 2002
52
US
I am trying to design a salary receipt on which the details section is divided into two columns, some being printed on the left side and some on the right depending on the code of the detail, eg.
Code:
!-------------------------------------------------------!
! COD DESCRIPTION       VALUE ! COD DESCRIPTION    VALUE!
!-----------------------------!-------------------------!
! 001 Salary            5,000 ! 050 Tax Social      320 !
! 006 Premium Bonus     1,000 ! 053 I.R.S.          500 !
!-----------------------------!-------------------------!
!                       6,000 !                     830 !
!-------------------------------------------------------!
!                                   Total         5,170 !
!--------------------------------------------------------
The database is ordered by COD. Then I want the total of each column and a final total which is left-total minus right-total. Is this possible without reverting to subreports? I'm going to try to group by COD and have two group footers, displaying (a) if COD is less than 50 and (b) if 50 or more, using the 'Underlay Follwing Section' option.
Is there a less complicated way?
Any help appreciated.

 
Here is an example of one that I have used to get the quantities in a cross-tab like order for the days of the week. It is difficult to read in this format, so paste it into Notepad first.

SELECT
Sum(Case DateName(Weekday,BDate) When 'Monday' Then BQUAN Else End) as [Monday],
Sum(Case DateName(Weekday,BDate) When 'Tuesday' Then BQUAN Else 0 End) as Tuesday,
Sum(Case DateName(Weekday,BDate) When 'Wednesday' Then BQUAN Else 0 End) as Wednesday,
Sum(Case DateName(Weekday,BDate) When 'Thursday' Then BQUAN Else 0 End) as Thursday,
Sum(Case DateName(Weekday,BDate) When 'Friday' Then BQUAN Else 0 End) as Friday,
Sum(Case DateName(Weekday,BDate) When 'Saturday' Then BQUAN Else 0 End) as Saturday,
Sum(Case DateName(Weekday,BDate) When 'Sunday' Then BQUAN Else 0 End) as Sunday,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) as Items, BPRICE,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) * BPRICE as [Ext. Price]
FROM bil
 
I see where your going but I'm not sure if it's applicable to my situation. I've just discovered the Layout Tab option in CR 8.0 which is along the lines of what I want, but still doesn't quite get there, as there is no way to specify that all numbers under 50 are in the left column, and all above are in the right column (at least to me it is not obvious).
This has to be finished today, so looks like it's going to have to be two subreports after all, left (<50) and right >= 50) with shared variabes passing back to the main report.
Obviously if anybody else has any ideas for solving this type of problem....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top