Normal Topic My report command button does not work (Read 828 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
My report command button does not work
Nov 20th, 2007 at 9:49pm
Print Post Print Post  
Hi everyone,
My report command button does not work, here is the code any help would be great.


// TO PRINT THE STATEMENT REPORT

var vSTI as INT
var vSTItxt as String
var vReport as String

VReport = "Main"      // CHANGE TO ACTUAL REPORT NAME

GlobalValue("gvStatementAccountNo", Client Number)      // GET THE ACCOUNT NUMBER
vSTI = @SelectTreeItem("Search Update Menu!Navigation!Save Record")

vSTItxt = "Search Update Menu!Results Commands!Reports!EZY Loan!" + vReport + " (Preview)"

vSTI = @SelectTreeItem(vSTItxt)            // Run the report


I am running 2.03, i think its to do with the globalvalue area am i wrong?
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: My report command button does not work
Reply #1 - Nov 20th, 2007 at 11:27pm
Print Post Print Post  
It looks like you are SETTING the Global Value vs. GETting it as in your comment.
But I don't see anything wrong with that.

You are not using the Global Value in the strings to print the report, so that is probably not part of your problem.

Was this an upgrade from version 1.x ?  Looks like syntax for version 1.x.  Version 2.0  syntax for Menu Tree is different.

Have you checked the exact spelling of the vSTItxt line?  Especially pay attention to space characters.  Have you replaced "MAIN" with actual report name, or created a report named "MAIN"?

Symptoms?  You say it does not work.  Does nothing happen?   Does it hang?  Any error message?
Is code for the button in On Element Enter?  SelectTree shows this is for Search/Update mode, are you trying this in ADD mode.  You may want to change code to allow for both Modes.

Don't mean to confuse, just throwing out a number of possibilities to look at.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: My report command button does not work
Reply #2 - Nov 20th, 2007 at 11:37pm
Print Post Print Post  
Hi Bob, and thanks for the time and effort your giving me.

Is there a tree listing for version 2?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: My report command button does not work
Reply #3 - Nov 20th, 2007 at 11:46pm
Print Post Print Post  
Yes, but you want to use the PrintAReport() command instead. Welcome to version 2!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: My report command button does not work
Reply #4 - Nov 20th, 2007 at 11:59pm
Print Post Print Post  
Thank you Hammer, didnt know about the command.
  
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: My report command button does not work
Reply #5 - Nov 21st, 2007 at 12:12am
Print Post Print Post  
Hammer i thank you from the bottom of my heart, this command is great it now works, i now have this code and it WORKS!!!! YAAAA



// TO PRINT THE STATEMENT REPORT

var vSTI as INT
var vSTItxt as String
var vReport as String

var vFilename as string

VReport = "Main"      // CHANGE TO ACTUAL REPORT NAME

GlobalValue("gvStatementAccountNo", Client Number)      // GET THE ACCOUNT NUMBER
vSTI = @SelectTreeItem("Search Update Menu!Navigation!Save Record")

#include "sbasic_include.sbas"

vFilename = @PrintAReport("Main", REPORT_MODE_HTML_PREVIEW, PRINT_ORIENTATION_LANDSCAPE, 0, -1, -1, -1, -1, -1, -1)
WriteLn(VFilename)
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: My report command button does not work
Reply #6 - Nov 21st, 2007 at 12:23am
Print Post Print Post  
Cool. BTW, if you put the following line at the top of GLOBAL CODE instead of in the middle of your code, you can then use the defines in the rest of your code as needed.

#include "sbasic_include.sbas"
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged