How to get the value of a Text in DabaBand

Stimulsoft Ultimate discussion
Post Reply
lee
Posts: 2
Joined: Fri Jul 29, 2011 9:05 am
Location: United States

How to get the value of a Text in DabaBand

Post by lee »

I wanted to call a method from the report using Click event and pass the value of the clicked text from a databand.
right now i tried the below:

OnClick - event
------------------------------
MyClass.SendMsg(this.Text4.Text) --- returns Empty string

MyClass.SendMsg(Products.ProductName) --- always return the same value

namespace MyClassNamespace
{
public class MyClass
{
public static void SendMsg(string value)
{
MessageBox.Show(value);
}
}
}
Can you please help me make this work.

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

How to get the value of a Text in DabaBand

Post by HighAley »

Hello, Lee.
lee wrote:I wanted to call a method from the report using Click event and pass the value of the clicked text from a databand.
right now i tried the below:

OnClick - event
------------------------------
MyClass.SendMsg(this.Text4.Text) --- returns Empty string

MyClass.SendMsg(Products.ProductName) --- always return the same value

namespace MyClassNamespace
{
public class MyClass
{
public static void SendMsg(string value)
{
MessageBox.Show(value);
}
}
}
During report rendering exist two instance of each component (minimum two instance). One instance - component in report template. Second instance - component which created for rendered report. During creation of second instance report engine calculate expressions and write it to second instance. When you write expression like this:
{Text1.Text}
you call instances from report template which does not contain calculated values from expressions.

Please try to use this expression MyClass.SendMsg((sender as StiText).TextValue)

Thank you.
lee
Posts: 2
Joined: Fri Jul 29, 2011 9:05 am
Location: United States

How to get the value of a Text in DabaBand

Post by lee »

Hi HighAley,

(sender as StiText).TextValue returns Null/Empty value.
It only works when I use (sender as StiText).Text.

Is it really this way?

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

How to get the value of a Text in DabaBand

Post by HighAley »

Hello, Lee.
lee wrote:(sender as StiText).TextValue returns Null/Empty value.
It only works when I use (sender as StiText).Text.

Is it really this way?
Yes, it is. TextValue is something different.

Let us know if you need any additional help.

Thank you.
Post Reply