Page 1 of 1

Get the value from a specific Cell

Posted: Fri Nov 19, 2010 7:30 am
by Lug16
Hi everyone:

I have a table(in the dataset) where there is always a field in just a specific cell (Column[0],Row[0]), that I want to place in a textbox, apart from the table. Can I do that?
I know that a field in a table is loaded with this:

Code: Select all

        public void Table1_Cell4__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
        {
            e.Value = ToString(sender, DataTable.Column4, true);
        }
but this for a text box always return the last item of the DataTable.

Any Idea? :blush:

Get the value from a specific Cell

Posted: Fri Nov 19, 2010 8:00 am
by Alex K.
Hello,

You can use the following expression in TextBox

Code: Select all

{DataSource.DataTable.Rows[0]["columnName"].ToString()}
or

Code: Select all

{DataSource.DataTable.Rows[0][columnIndex].ToString()}
Thank you.

Get the value from a specific Cell

Posted: Fri Nov 19, 2010 8:41 am
by Lug16
Ok I did what you said, and I want to tell you something

The overload with the "columnName" works perfectly, but with the "columnIndex" error appears:

"The best overloaded method match for 'Stimulsoft.Report.Dictionary.StiRow.this[string]' has some invalid arguments"

Just for your info...

Thanks.


Get the value from a specific Cell

Posted: Fri Nov 19, 2010 8:49 am
by Alex K.
Hello,

Please check your expression. It must be
{DataSourceName.DataTable.Rows[0]["columnName"].ToString()}

Thank you.

Get the value from a specific Cell

Posted: Fri Nov 19, 2010 8:53 am
by Lug16
Aleksey wrote:Hello,

You can use the following expression in TextBox

Code: Select all

{DataSource.DataTable.Rows[0]["columnName"].ToString()}
or

Code: Select all

{DataSource.DataTable.Rows[0][columnIndex].ToString()}
Thank you.
You said with the columnIndex too, and that one fires the exception that I show you... It works great with "columnName".

Thank you...

Get the value from a specific Cell

Posted: Fri Nov 19, 2010 9:01 am
by Alex K.
Hello,

Please see the sample report in attachment.

Thank you.