CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 $fldsome_field equivalent in CCS?

Print topic Send  topic

Author Message
RonB
Posted: 04/29/2002, 3:17 PM

Is there an $fldsome_field equivalent in CCStudio?
I have a function I wrote for cc to display a date in european format in
this case I want to use this function on what would be $fldnews_date in CC
how do I code this in CCStudio?

In CC it looks like this:
$fldnews_date=showdbdate($fldnews_date);

The function showdbdate is as follows:

function showdbdate($field)
{
$day = substr($field, 8, 2);
$month = substr($field, 5, 2);
$year = substr($field, 0, 4);
$field= $day . "-" . $month . "-" .$year;
return $field;
}


Geert van der Ploeg
Posted: 04/30/2002, 5:53 AM

You would create a "Before Show" event on that particular field.

It would look something like this:

function news_before_show
{
global $news; //// name of the form

$news->news_date->setvalue(
showdbdate($news->news_date->Value));
}
=============
remarks:
- the "Value" in $news->news_date->Value is case-sensitive.

- You should not alter the news_date->Value manually, because the setvalue()
function does more than only setting $this->Value.

From classes.php:
function SetValue($Value)
{
$this->Value = $Value;
$this->Text = $this->GetFormatedValue($this->Format);
$this->DBValue = $this->GetFormatedValue($this->DBFormat);
}



"RonB" <r.borkent@123chello.nl> wrote in message
news:aakgp8$u87$1@news.codecharge.com...
> Is there an $fldsome_field equivalent in CCStudio?
> I have a function I wrote for cc to display a date in european format in
> this case I want to use this function on what would be $fldnews_date in CC
> how do I code this in CCStudio?
>
> In CC it looks like this:
> $fldnews_date=showdbdate($fldnews_date);
>
> The function showdbdate is as follows:
>
> function showdbdate($field)
> {
> $day = substr($field, 8, 2);
> $month = substr($field, 5, 2);
> $year = substr($field, 0, 4);
> $field= $day . "-" . $month . "-" .$year;
> return $field;
> }
>
>
>

Alexey Alexapolsky
Posted: 04/30/2002, 6:37 AM

fldsometing equivavalent is

FormName.ControlName.Value

Since CCS is more object oriented than CC
If you need to use it like in BeforeShow , use BeforeShowRow event :

members.name.Value = "It works"

--
Alex
CodeCharge Developer


"RonB" <r.borkent@123chello.nl> wrote in message
news:aakgp8$u87$1@news.codecharge.com...
> Is there an $fldsome_field equivalent in CCStudio?
> I have a function I wrote for cc to display a date in european format in
> this case I want to use this function on what would be $fldnews_date in CC
> how do I code this in CCStudio?
>
> In CC it looks like this:
> $fldnews_date=showdbdate($fldnews_date);
>
> The function showdbdate is as follows:
>
> function showdbdate($field)
> {
> $day = substr($field, 8, 2);
> $month = substr($field, 5, 2);
> $year = substr($field, 0, 4);
> $field= $day . "-" . $month . "-" .$year;
> return $field;
> }
>
>
>

RonB
Posted: 04/30/2002, 2:10 PM

Thanks it worked.
I take it I don not have to declare the date function everytime I want to
use it. Can I include functions I wrote so they are available for all pages
in the project. Like the modules section in CC?

Ron Borkent


"Geert van der Ploeg" <news@geert.triple-it.nl> schreef in bericht
news:aam448$p0t$1@news.codecharge.com...
> You would create a "Before Show" event on that particular field.
>
> It would look something like this:
>
> function news_before_show
> {
> global $news; //// name of the form
>
> $news->news_date->setvalue(
> showdbdate($news->news_date->Value));
> }
> =============
> remarks:
> - the "Value" in $news->news_date->Value is case-sensitive.
>
> - You should not alter the news_date->Value manually, because the
setvalue()
> function does more than only setting $this->Value.
>
> From classes.php:
> function SetValue($Value)
> {
> $this->Value = $Value;
> $this->Text = $this->GetFormatedValue($this->Format);
> $this->DBValue = $this->GetFormatedValue($this->DBFormat);
> }
>
>
>
> "RonB" <r.borkent@123chello.nl> wrote in message
>news:aakgp8$u87$1@news.codecharge.com...
> > Is there an $fldsome_field equivalent in CCStudio?
> > I have a function I wrote for cc to display a date in european format in
> > this case I want to use this function on what would be $fldnews_date in
CC
> > how do I code this in CCStudio?
> >
> > In CC it looks like this:
> > $fldnews_date=showdbdate($fldnews_date);
> >
> > The function showdbdate is as follows:
> >
> > function showdbdate($field)
> > {
> > $day = substr($field, 8, 2);
> > $month = substr($field, 5, 2);
> > $year = substr($field, 0, 4);
> > $field= $day . "-" . $month . "-" .$year;
> > return $field;
> > }
> >
> >
> >
>
>


   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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