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

Passing value between main report and subreport

Status
Not open for further replies.

Matapedia

Programmer
Jan 31, 2001
10
CA
Hi,

I'm looking for how to passing value from subreport to main report. I want to do something like Public variable in VB.

Help me plz!

Thanks
 
Well without a lot of information it's difficult to help you. But two possible solutions would be to create a global variable in PowerBuilder and use that between your reports. To declare a powerbuilder open any of your windows, then click on Declare menu and select Global Variables… from the list. Then just declare the variable like you would in any normal piece of code. You second option and a little more tricky would be the message object. So when opening another window you send it the variable by using the openwithparm function, and then retrieving the variable at the other end with the message.doubleparm / stringparm / powerobjectparm statement. Hope this helps.

Tentacle
e-mail: contact_tentacle@hotmail.com
 
You want to use the message.object for sure. Here is a sample of how to use it. If you want to pass more than one variable type then you can create a stucture and pass that.

//this is where you set the variables and open the window
//str_pass.s string[]

istr_pass.s[1] = is_cocode
istr_pass.s[2] = is_subsid
OpenWithParm( w_window, istr_pass )

//this goes in the open of w_window
istr_pass = Message.PowerObjectParm

ls_cocode = istr_pass.s[1]


If all you want to pass is a string you can this way

OpenWithParm( w_window, "Hello There" )

//OPen event of w_window
string ls_msg

ls_msg = message.StringParm

Hope this a little more clear for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top