We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Create excel report without specifying rows/column range number

Thread ID:





121619 Jan 8,2016 02:09 AM UTC Jan 11,2016 09:57 AM UTC ASP.NET MVC (Classic) 3
Tags: XlsIO
Asked On January 8, 2016 02:09 AM UTC

Is there an easier way to create excel report without the need to manually write out the column/rows numbers?

I like a simple method like below.


foreach(var value in values)

There is the ImportData function that take a list but that does not do what I want so I need to loop through each values and apply custom values.

Dilli Babu Nandha Gopal [Syncfusion]
Replied On January 8, 2016 01:51 PM UTC

Hi Ov,

We are not clear with your requirement. As far we have understood, you can set a named range for the cells you wanted to access. The following code example illustrates this behavior.

Code Snippet:

//Adding named range to the workbook           

IName workBookName = workbook.Names.Add("WorkBookName");

workBookName.RefersToRange = worksheet.Range["A1"];

//Looping through the Named Ranges in a workbook.

worksheet["WorkBookName"].Value = "Sample";

We have shared a sample for your reference which can be downloaded from following link

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/NamedRange-1585087498

To know more about named range in XlsIO, kindly go through the following UG documentation link

UG Documentation link:  http://help.syncfusion.com/file-formats/xlsio/working-with-formulas#defined-names

The provided sample may help you if your requirement is similar. If not, please share us the requirement in detail to provide the solution at the earliest.


Dilli babu.

Replied On January 8, 2016 01:59 PM UTC

I am trying to avoid specifying the rang elike A1, A2. 
This is tricky to loop through.

I am looking for a simple method that just write and the library work out which row/columns it should go.

Dilli Babu Nandha Gopal [Syncfusion]
Replied On January 11, 2016 09:57 AM UTC

Hi Ov,

The possible ways to access a cell or a range in a worksheet is explained briefly in the following UG documentation link. Kindly refer to this and let us know if this helps.

UG Documentation link: http://help.syncfusion.com/file-formats/xlsio/worksheet-cells-manipulation#accessing-a-cell-or-a-range

If still you are not able to achieve your requirement, please share us a model or a screen-shot explaining your behavior, which will help us to provide a prompt solution.

Dilli babu


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon