CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Well, I just don't know! Adding a label to a page.

Print topic Send  topic

Author Message
saseow

Posts: 744
Posted: 02/16/2005, 6:27 AM

I have tried every example from the forums and from the help files with no success at all.

All I want to do is add a label to a page and assign some text to it in the before show event.. The last thing I have tried is the "Adding a Label to the Page" in the help file step by step. The code it produces is:

//Retrieve Value for Control @7-0145785F
global $header_participants;
$header_participants->Label1->SetValue("Testing");
//End Retrieve Value for Control

The error it gives is:

Fatal error: Call to a member function on a non-object in C:\php Webs\mindfeel\header_participants_events.php on line 30.

If anyone can shed some light on this ..... you have no idea how happy I would be. I have spent about 4 hours trying various code to get this working.

Thanks,
Trevor
View profile  Send private message
aradi

Posts: 66
Posted: 02/16/2005, 7:49 AM

Hi,

As i understood you question that you want to show the content of a label on a page. After adding the Label ( i call it LabelName) to the page just do the following:

in design mode:
1- Click on the label
2- choose Events in the properties window
3- choose Before Show ->Add code
4- After "Global $labelName" add :
$Label1->SetValue("Testing");

Your code should look like this :

global $LabelName;
$LabelName->SetValue("Testing");

This is one way to do it.
View profile  Send private message
aradi

Posts: 66
Posted: 02/16/2005, 7:53 AM

oops Typo mistake in #4 should be
$LabelName->SetValue("Testing");
View profile  Send private message
saseow

Posts: 744
Posted: 02/16/2005, 9:45 AM

Thanks for the reply aradi! I would have thought that this would worj as well but i get the following error:


Fatal error: Call to a member function on a non-object in C:\php Webs\mindfeel\header_participants_events.php on line 33

My code is:

//Custom Code @7-1E8335A6
// -------------------------
global $header_participants;

global $Label1;
$Label1->SetValue("Testing");
// Write your own code here.
// -------------------------
//End Custom Code

Any more ideas?
View profile  Send private message
Martin K.
Posted: 02/16/2005, 10:02 AM

Hello.
Mybe this works?:
My code is:

//Custom Code @7-1E8335A6
// -------------------------
global $header_participants;
$header_participants->Label1->SetValue("Testing");
// -------------------------
//End Custom Code


Greets Martin
saseow

Posts: 744
Posted: 02/16/2005, 8:25 PM

Thanks Martin for the answer but I still get the following error:


Fatal error: Call to a member function on a non-object in C:\php Webs\mindfeel\live_participant_answers_events.php on line 25

This has really got me stumped!
View profile  Send private message
peterr


Posts: 5971
Posted: 02/16/2005, 8:41 PM

Is this an includable page?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
saseow

Posts: 744
Posted: 02/17/2005, 5:36 PM

Yep it is.

I have sorted it all out now.

Thanks to all who helped!

Trevor
View profile  Send private message
Nicole

Posts: 586
Posted: 02/18/2005, 3:12 AM

Trevor,
when page is includable one the code used to access its controls or connections is a bit different from a code of normal pages. Namely the form’s name and connection object name should be predefined with the includable control name. By default it is the same as includable page name.
E.g. you have an includable page called Header. You added it to index page and assign to includable control name MyHeader. In this case the code on Header page should look like:
  
global $MyHeader;  
$MyHeader->Label1->SetValue("test");  

_________________
Regards,
Nicole
View profile  Send private message
saseow

Posts: 744
Posted: 02/18/2005, 6:09 AM

Thanks Nicole, Just what I needed!

Regards,

Trevor
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.