Hot Topic (More than 10 Replies) Sesame 1.X Report Problem (Read 1662 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Sesame 1.X Report Problem
Jan 13th, 2011 at 1:50am
Print Post Print Post  
Hey all,

I have a report -- it has subtotals and totals.  On the subtotal line, I need it to calculate LE1 + LE2 - LE3.  However, any time I put a subtraction calculation, I get the following programming error:

Code
Select All
Error while parsing module: "SUBTOTAL (0)":
Type mismatch error (operation is not defined for the types of operands)
 



Is there a workaround to this?

Thanks!
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Sesame 1.X Report Problem
Reply #1 - Jan 13th, 2011 at 3:02am
Print Post Print Post  
Are one of those LEs bound to a TEXT field? If so, try wrapping it in @ToNumber().
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Sesame 1.X Report Problem
Reply #2 - Jan 13th, 2011 at 4:32pm
Print Post Print Post  
Are you trying to do Math on the Sum elements themselves in the same report section that they are in?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #3 - Jan 14th, 2011 at 3:31am
Print Post Print Post  
Hey Ray!

I'm trying to do calculations on the sum elements.  They are all money fields.  I tried @tonumber around the values, and it got rid of the error, but only returned 0 values, so still a dead end.

For example, client 1 has the following values summarized from 5 payments.

[A] Payments To Me, [B] Payments Dir, [C] Fees Here, [D] Fees Dir, [E] Tax.

I need a total for each client in each column, and then a summarized value of [C] + [D] - [A] + [E], as long as there is a flag value of 1 in the client screen.  If there is a flag value of 2, the formula needs to be just [A].

Suggestions?
  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #4 - Jan 14th, 2011 at 5:05am
Print Post Print Post  
After a couple of hours, I fixed my sum problem by creating invisible values on each item line, and totalling them up.  Not perfect for calculating taxes, but close enough. 

Now I only have a name problem ..  Smiley

Each line in my report has a client number and a spot for client name.  I'm having a problem carrying the client number and name down to the subtotal line.  I managed to get the client number by using a summary field (high) of the listed client numbers, but nothing I put in for name will work.  I've tried:

SubtotalName = LineName (doesn't work -- every subtotal name is the same for all clients)
SubtotalName = @xlookupref(@FN, subtotalclientnumber, sales screen!cltno, cltname) (doesn't work, returns 0)

Any idea what I can do here?

  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Sesame 1.X Report Problem
Reply #5 - Jan 14th, 2011 at 8:15pm
Print Post Print Post  
Hello Blair,

Yes for doing math on Sum fields you had to go through some hoops to get the values in version 1. In version 2 there is a call that can get the values of the Sum elements in the same section of the report. If you're just using this single user at the present time there is a great sale going on now for version 2 personal.

To do what you want to do, you'll need to declare a Static in Global Code, Set the Static in an on Print event of one of your Header elements to be the value of the Client Name element in the group body and in the Group footer set your element equal to the static. It may sound kind of complicated but it's only 3 lines of code so not that hard.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #6 - Jan 15th, 2011 at 12:16am
Print Post Print Post  
I'd love to switch to version 2 ... probably in 90 days, but until them ... Sad

Okay, I tried what you explained, and it didn't work.  Here's what I did.

GLOBAL CODE: stat sCltName as string

Group Header 1 (My report titles) I created an invisible unbound value box called HoldingName.

HOLDING NAME ON PRINT: HoldingName = CLTNAME

Group Header 2 (A report title underline series of Line Boxes)

Body: This is where all my invisible data that will add up (evenutally) goes.  I have an unbound value box callled CLTNAME.

CLTNAME ON PRINT:
   var vCltName as string
   vCltName = (@Xlookupsourcelist(@FN, LE0, "Sales Screen!CltNo", "CltName"))
   CLTNAME = @accessstringarray(vCltName,1)

Group Footer 3 (My displayed total per client line).  Sums of body fields, only visible.  To get the client name to appear in the Footer, I have a High Value Box of the invisible client number above.  I created an unbound valuebox called Pullname on this line to be where the client name shows.

PULLNAME ON PRINT: PullName = sCltName

Group Footer 2 (another line of line boxes before the grand total)

Group Footer 1 (My Grand Total) which needs no client name, just sums of all of Group Footer 3 subtotals.

What did I do wrong?

  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Sesame 1.X Report Problem
Reply #7 - Jan 17th, 2011 at 2:45pm
Print Post Print Post  
HOLDING NAME ON PRINT: should be sCltName = CLTNAME

Try that and let me know what the result is.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #8 - Jan 21st, 2011 at 4:36am
Print Post Print Post  
I made the change, but still no go ... group footer 3 is still blank ...
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Sesame 1.X Report Problem
Reply #9 - Jan 21st, 2011 at 3:47pm
Print Post Print Post  
HOLDING NAME ON PRINT: should be sCltName = LE0

Try that and let me know what the result is. It should be the Client Number in the footer.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #10 - Feb 12th, 2011 at 11:40pm
Print Post Print Post  
OK, that worked ... I got the client number in the footer.  Now how do I get the name to appear?

Here's my sample report ... the top line is the body (which I want to make invisible once I get the subtotal line below showing the client name...

Thanks!
Clt No            Clt Name            Pd Here            Pd Dir            Comm Here            Comm Dir            HST            Gross            Net            Invoice            Trust Fund
                                                                                                                             
3010            ABC Company            $525.00                        $157.50                        $20.48                                                      
3010            3010            $525.00            $0.00            $157.50            $0.00            $20.48            $0.00            ($347.03)            $0.00            $347.03      
                                                                                                                             
                       $525.00            $0.00            $157.50            ($347.03)            $20.48            $0.00            ($347.03)            $0.00            $347.03      
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Sesame 1.X Report Problem
Reply #11 - Feb 14th, 2011 at 8:08pm
Print Post Print Post  
Hello Blair,

Since you have the Client Number in the footer you can do an XLookup and get the Client Name and display that in the footer as well. You can do it in the PullName on Print event.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Sesame 1.X Report Problem
Reply #12 - Feb 17th, 2011 at 3:02am
Print Post Print Post  
Hallefrickinleujia!  It works!  Thanks Ray!

One report down, 37 to go ... Smiley
  
Back to top
IP Logged