This is a migrated thread and some comments may be shown as answers.

Filter Rows of Imported Spreadsheet

2 Answers 107 Views
SpreadProcessing
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Sep 2015, 04:37 PM

We currently have a web application that allows the user to upload (utilizing the RadAsyncUpload control) files of different formats (csv,html,txt,xlsx) where the file stream (using the IWorkBookFormatProvider) is ultimately converted to a PDF and stored in a MSSQL database record.  The purpose of this process is so that we can have varying formats of input data and a common datatype that can be displayed in the web application.  The problem is that some of the csv, txt and xlsx files can have as many as 750,000 rows of data and for the purpose being discussed, we are only interested in the first 50 rows of the file.  I can use RowSelection and Remove the unwanted rows on smaller files.  However, this takes a long time to accomplished on large files.  How can I:

  1. Filter the worksheet rows so that I only get the first 50, or
  2. Insert the first 50 rows from worksheet A to worksheet B.

Thanks,

 Michael

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Demirev
Telerik team
answered on 21 Sep 2015, 08:58 AM
Hi Michael,

Currently, there is no way to import only part of the document.

The only thing I could offer you is applicable for CSV and TXT files only. These two file types contains values separated by new lines, each line contains the values from one row of the worksheet. If it works for you, you can preprocess the TXT and CSV files so you get only the first 50 lines of them, create new file and import it using RadSpreadProcessing.

Handling XLSX file format is more complicated. The XLSX file is ZIP archive which contains XML files. The worksheets are separate files in the archive. You could get them and try to preprocess them, so you take the first 50 rows, which are defined using the <row> tag and skip the rest rows and create new XML document with reduced number of rows you can import it using RadSpreadProcessing. I am not sure if this processing of the XML files will be much faster than importing the document. But it will spare the time needed to store the cell values in the data structures of the processing library.

Regards,
Nikolay Demirev
Telerik
0
Michael
Top achievements
Rank 1
answered on 21 Sep 2015, 01:12 PM

Hey Nicolay,

 Thanks for getting back to me and I will give your suggestion a shot.

Regards,

Michael

Tags
SpreadProcessing
Asked by
Michael
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or