Page 1 of 1
How to get the value of a Text in DabaBand
Posted: Mon Aug 01, 2011 10:34 am
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
How to get the value of a Text in DabaBand
Posted: Tue Aug 02, 2011 2:11 am
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.
How to get the value of a Text in DabaBand
Posted: Tue Aug 02, 2011 9:41 am
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
How to get the value of a Text in DabaBand
Posted: Wed Aug 03, 2011 7:21 am
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.