Completed
Last Updated: 17 May 2021 08:30 by ADMIN
Release R2 2021
ADMIN
Deyan
Created on: 25 Apr 2016 17:37
Category: SpreadProcessing
Type: Feature Request
21
SpreadProcessing: Introduce conversion from DataTable to RadWorkbook/RadWorksheet and vice versa
Expose an easy way to create .xlsx documents from DataTable objects.
6 comments
ADMIN
Martin
Posted on: 13 Apr 2020 11:33

Hi Indy,

Thank you for the provided feedback.

This item has a relatively high priority in our backlog but at this point, I am unable to provide you with a timeframe for solving this issue as it is currently not scheduled for implementation. I apologize for the inconvenience this missing functionality might be causing you. Please, make sure you cast your vote for its implementation as well as subscribe to the task by clicking the Follow button so you can receive updates about status changes.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Indy
Posted on: 10 Apr 2020 17:25

Yes this efature would be much appreciated, would be great to get in a near future release

 

Happy to buy the developer coke and pizza! :) 

ADMIN
Nikolay Demirev
Posted on: 22 Nov 2019 11:13

Hi Doug,

Thank you for your feedback. We are tracking the interest for this feature, but still, it is not in our immediate plans for implementing.

While waiting for it you could use this sample code in order to create a Workbook from a DataSet:

private Workbook ImportDataSetToWorkbook(DataSet dataSet)
{
	for (int i = 0; i < dataSet.Tables.Count; i++)
	{
		workbook.Worksheets.Add();

		DataTable currentTable = dataSet.Tables[i];
		Worksheet currentWorksheet = workbook.Worksheets[i];

		currentWorksheet.Name = currentTable.TableName;

		ImportDataFromDataSetToWorksheet(currentTable, currentWorksheet);
	}
}

private void ImportDataFromDataSetToWorksheet(DataTable table, Worksheet worksheet)
{
	for (int col = 0; col < table.Columns.Count; col++)
	{
		CellSelection cell = worksheet.Cells[0, col];
		cell.SetValue(table.Columns[col].ToString());
	}

	for (int row = 0; row < table.Rows.Count; row++)
	{
		var currentRow = table.Rows[row];

		for (int col = 0; col < table.Columns.Count; col++)
		{
			CellSelection cell = worksheet.Cells[row + 1, col];
			var currentCellValue = currentRow.ItemArray[col];

			if (currentCellValue.GetType() == typeof(double) || currentCellValue.GetType() == typeof(int))
			{
				cell.SetValue((double)currentCellValue);
			}
			else if (currentCellValue.GetType() == typeof(DateTime))
			{
				cell.SetValue((DateTime)currentCellValue);
			}
			else if (currentCellValue.GetType() == typeof(bool))
			{
				cell.SetValue((bool)currentCellValue);
			}
			else
			{
				cell.SetValue(currentCellValue.ToString());
			}
		}
	}
}

Regards,
Nikolay Demirev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Doug
Posted on: 17 Nov 2019 01:31
I agree completely.  Hope this feature is added soon.  We also use SyncFusion at my company.  SyncFusion has an ImportDataTable that makes it much easier than what Progress Telerik currently has.  You are falling behind your competition.
ADMIN
Tanya
Posted on: 27 Sep 2018 15:53
Hi,

Thank you for sharing your feedback. Please, make sure to cast your vote for this implementation and continue following the item so you can receive updates about status changes on it.

Until this task gets implemented, you can add the data from the DataTable by iterating the records and adding them using the SetValue() method of the CellSelection class. More information about this method is available at https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties#value-property .

Regards,
Tanya
TRANSEPT
Posted on: 25 Sep 2018 11:01
Hi Team , 
Hope you will start very soon developing this part , it's really important such feature ,

Thanks for your efforts