Get the value from a specific Cell

Stimulsoft Reports.NET discussion
Post Reply
Lug16
Posts: 9
Joined: Mon Nov 15, 2010 8:03 am

Get the value from a specific Cell

Post 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:
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Get the value from a specific Cell

Post 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.
Lug16
Posts: 9
Joined: Mon Nov 15, 2010 8:03 am

Get the value from a specific Cell

Post 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.

Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Get the value from a specific Cell

Post by Alex K. »

Hello,

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

Thank you.
Lug16
Posts: 9
Joined: Mon Nov 15, 2010 8:03 am

Get the value from a specific Cell

Post 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...
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Get the value from a specific Cell

Post by Alex K. »

Hello,

Please see the sample report in attachment.

Thank you.
Attachments
705.SampleReport.mrt
(14.8 KiB) Downloaded 558 times
Post Reply