Can get excel value using DataSources().get in user code

Ask general questions here.
chanow
Posts: 5
Joined: Tue Jan 15, 2013 11:00 am

Can get excel value using DataSources().get in user code

Post by chanow » Mon Jan 21, 2013 3:38 pm

Dear All,

I have problem with object DataSources()

Is there a way to get each excel column value in a row with this function?

Now I can use below code to get row count and column count

/////
var getExcel = DataSources.Get("MyConnector");

int column_count = getExcel.Columns.Count;
int row_count = getExcel.Rows.Count;
/////

if i got column_count = 3

can someone help me to get those 3 column values in excel file?

thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Can get excel value using DataSources().get in user code

Post by Support Team » Tue Jan 22, 2013 8:59 am

Hello,

Please take a look at the example code below:
for (int row = 0; row<row_count;row++)
{
	Report.Info("========== Row: " + row);
	for (int column = 0; column<column_count; column++)
	{
		Report.Info("Column: " + column + " Value: " + getExcel.Rows[row].Values[column]);				
	}				
}
Regards,
Markus (T)
.
Image