Event in PHP

Stimulsoft Reports.PHP discussion
Post Reply
kaveh
Posts: 7
Joined: Mon Jul 22, 2019 3:54 pm

Event in PHP

Post by kaveh »

Hello,
i need to execute some codes on BeforePrint event.
when i put something like : alert("hello"); it works perfectly
but when i put : Text2.Text="hello"; it doesn't work, no errors, nothing
is there any way to add some lines of codes on BeforePrint of an object.

Thanks
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Event in PHP

Post by HighAley »

Hello.

Please, write the name of the property starting the small letter.

Code: Select all

Text1.text="hello"; 
This code works.

Thank you.
kaveh
Posts: 7
Joined: Mon Jul 22, 2019 3:54 pm

Re: Event in PHP

Post by kaveh »

I really appreciate for your response.
you're right, i thought that it's like the .Net designer.
anyway, how is the syntax for html5 designer, i use JS for php and calling the designer from code.
for example i need some calculation and then move an image. here is my codes:

double mean=1.11;
double min=mean*0.85;
double max=mean*1.25;
double value=score1; //comment : score1 is a variable

double left=0;

if(value>min && value<max)
{
left=barGray1.left+(value-min)*barGray1.width/(max-min)-arrow1.width/2;
}
else if (value>max)
{ left=barGreen1.left+barGreen1.width/3-arrow1.width/2;
}
else if (value<min)
{ left=barGray1.left-barRed1.width/3-arrow1.width/2;
}


lblScore1.left=left;

thanks you very much
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Event in PHP

Post by Lech Kulikowski »

Hello,

Unfortunately, the code in events in the JS version is not supported. Only limited operations may be used.

Thank you.
kaveh
Posts: 7
Joined: Mon Jul 22, 2019 3:54 pm

Re: Event in PHP

Post by kaveh »

Hello,
actually i guess it's supported, but in java language. i found the solution. just to share with the others :
/////////////////////
var mean=1.11;
var min=mean*0.85;
var max=mean*1.25;
var value=score1;
var left=0;

if(value>min && value<max)
{
left=barGray1.left+(value-min)*barGray1.width/(max-min)-arrow1.width/2;
}
else if (value>max)
{ left=barGreen1.left+barGreen1.width/3-arrow1.width/2;
}
else if (value<min)
{ left=barGray1.left-barRed1.width/3-arrow1.width/2;
}
arrow1.left=left;
/////////////////
thanks
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Event in PHP

Post by Lech Kulikowski »

Hello,

Thank you for the provided solution.

Thank you.
kaveh
Posts: 7
Joined: Mon Jul 22, 2019 3:54 pm

Re: Event in PHP

Post by kaveh »

Hello,
in html5 designer (js), i could use Variables in the events like below : (value is predefined variable in dictionary)
value="2333";
Text41.text=value;

this works but how can i use field names like: value=ds1.pName;
even: value={ds1.pName}; didn't work for me.
could you please help me?

Thank you.
Attachments
2019-07-31_12h28_08.png
2019-07-31_12h28_08.png (112.69 KiB) Viewed 3536 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Event in PHP

Post by Lech Kulikowski »

Hello,

Unfortunately, the code in events in the JS version is not supported. Only limited operations may be used.

Thank you.
Post Reply