GridView - Displaying Text in a GridViewDateTimeColumn

1 Answer 114 Views
GridView
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Curtis asked on 07 Apr 2022, 09:22 PM

Hello!

I've got a grid that has multiple, overlapping rows of data.  The purpose of this grid is to build an exportable Excel spreadsheet. 

Here would be a very simple example of how I need the spreadsheet to look in Excel

A                B                C                D                E

Name         DOB          Status       Amount 

John Q       12/12/20    Active       $100.00

 

As you can see - the Excel Columns are the standard, default A..E. 

Row 0 holds the "Headers" for the data directly beneath. 

Row 1 holds the actual data - but when I export this to Excel, I want to be able to tell it "This cell is text" or "This cell is a Date/Time" etc.

Is this possible? 

 

Thanks for the great products!

Curtis. 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 08 Apr 2022, 01:32 PM

Hi Curtis,

Thank you for the provided details.

You could check the Format Codes options of the columns and share if ExcelExportType and ExcelExportFormatString properties are working for you.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 08 Apr 2022, 06:31 PM

Hello Dinko!  First, thank you for the very quick reply!

I have experimented with format codes by setting ExcelExportType (and ...FormatString) and while they are not a solution for my current issue, they were will be very useful for another issue I need to figure out! 

For my current issue, I need to alter the Type for each cell in a Column (Sometimes 'string', others will be 'datetime' or 'currency' etc etc.)   I did a LOT of reading of something i didn't even know existed last night:  SpreadProcessing!  This API holds has everything i need (so far!)  It's a bit cryptic in places and I had some issues converting the language but I got there in the end and i think this will work perfectly.

 

Again thank you for your quick reply!

-Curtis

 

Dinko | Tech Support Engineer
Telerik team
commented on 13 Apr 2022, 09:06 AM

I am happy to hear that you have found a solution for your requirement. If further questions arise, you can open a new forum thread with your questions inside and we will be happy to help.
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 13 Apr 2022, 06:04 PM

At this point my only concern is - time.  My test database is only 1500 rows which takes about 10-15 seconds to process (including file save.) The file it creates is around 900meg . What happens when i hit a production database and that has 300000 rows? 

Currently I'm Suspending Layout and I'm disabling History but I fear that will not be enough for most of my larger databases.

Is there a way to "write the spreadsheet as I go?"  This entire operation is sequential - with only formatting occurring at the very wend (auto-sizing columns quite literally needs the entire database to function correctly!)  

 

I anxiously await your reply :)

Kindest regards,

Curtis

Dinko | Tech Support Engineer
Telerik team
commented on 18 Apr 2022, 08:16 AM

To have a better look at your set-up and propose a suitable solution, could it be possible to isolate your scenario in a sample project. This way I can debug it on my side and see why is taking the specified time to export the grid. At this point, I can only guess what is going on. 

I am looking forward to your reply.

Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 18 Apr 2022, 05:30 PM

No, i'm sorry.  The data is not something I can share.  I'm looking at all of the "ME" things first before pursuing this with Telerik. :)
Dinko | Tech Support Engineer
Telerik team
commented on 21 Apr 2022, 08:28 AM

Without your implementation, I can't be sure what is going on and I can only guess. Could it be possible to share some images of what you have in the UI? For example, you can screenshot the RadGridView and cover all sensitive information. Do you have custom cells? How many columns do you have? 

Generally speaking, 1500 rows is not that much, and exporting these rows should take less time. Can you share how you are exporting the control? This will give me an idea of which methods are used.

As a side note, you mentioned in your post that the production database will have 300 000 rows. In this case, you could use the RadSpreadStreamProcessing library for the export which is a light version of the RadSpreadProcessing. Using this library you can export big documents without loading them in the memory which will reduce the exporting time.

Tags
GridView
Asked by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or