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. Image for the cookie policy date
close icon

Pick List Problem with ExportDataTable

Thanks for you help with the pick list. It is working fine... how ever I have a problem. I have a worksheet with 10 columns. Column number two has a pick list of States. Since I don''t know how many rows a user will enter, I have defaulted the pick list to the first 1000 rows. When a user uses this form (enters two lines) and re-imports it back to gridview, the code:( sheet.ExportDataTable(10, 1, sheet.UsedRange.End.Row, 9, ExcelExportDataTableOptions.None) the sheet.UsedRange.End.Row is showing 1000. So I get a gridview of 1000 rows, but only two of the gridview rows are populated, the rest are blanks. How can I only get back the two rows that are populated with data and not the empty rows with the picklist? Thanks..

8 Replies

AD Administrator Syncfusion Team June 2, 2006 04:07 PM UTC

Hi Mia, I am afraid.I was unable to see the problem. I tried to export the excel with datavalidation list having datarange upto 1000 rows. Could you please modify the sample to show your problem. Please take a look at the attachment and let me know if you have any questions. ExtractData.zip BestRegards, Bharath


AD Administrator Syncfusion Team June 2, 2006 05:27 PM UTC

Bharath, I noticed that you are using simple: sheet.ExportDataTable(sheet.UsedRange,ExcelExportDataTableOptions.None); That code will take everything in Excel and put into the datagrid. My code is a little different. I am taking only data from row 10 to end of row. Is it possible sheet.UsedRange.End.Row adds every row that has the pick list? >Hi Mia, > >I am afraid.I was unable to see the problem. > >I tried to export the excel with datavalidation list having datarange upto 1000 rows. > >Could you please modify the sample to show your problem. > >Please take a look at the attachment and let me know if you have any questions. > > >ExtractData.zip > > > >BestRegards, > >Bharath


AD Administrator Syncfusion Team June 5, 2006 05:25 PM UTC

Hi, I am afraid.I was unable to reproduce the problem. Here is the code that I used for testing, sheet.ExportDataTable(10 (int firstrow),1 (int firstcolumn), (100 for eg.) sheet.UsedRange.End.Row (int maxrows), 1 (int maxcolumns),ExcelExportDataTableOptions.None); it exports 100 rows and 1 column(i.e from 10 to 109). and here is the sample that I used for testing: ExtractData.zip Please take a look at the attached sample and tell me if you still have the problem if so could you please modify the sample to reprodue the issus and send me, so that I can investigate further on this issue. Thanks, Bharath.


AD Administrator Syncfusion Team June 5, 2006 06:34 PM UTC

Bharath, :( Mine is a web form. And I am using your line of code in my web form.. and still I am getting all the rows with the Pick List regardless if any rows are populated. Is there a bug in the Web form vs Win Form? >Hi, > >I am afraid.I was unable to reproduce the problem. Here is the code that I used for testing, > > >sheet.ExportDataTable(10 (int firstrow),1 (int firstcolumn), (100 for eg.) sheet.UsedRange.End.Row (int maxrows), 1 (int > >maxcolumns),ExcelExportDataTableOptions.None); > > >it exports 100 rows and 1 column(i.e from 10 to 109). > >and here is the sample that I used for testing: > >ExtractData.zip > > >Please take a look at the attached sample and tell me if you still have the problem if so could you please modify the sample to > >reprodue the issus and send me, so that I can investigate further on this issue. > >Thanks, >Bharath.


AD Administrator Syncfusion Team June 5, 2006 06:52 PM UTC

Bharath, In your Sample.xls sheet, you have 4 rows of actual data and about 150 rows of Pick List. For my application, I only want to import those 4 rows of actual data into a datagrid. Currently, when I use your example, all 150 rows are imported into my datagrid. I only want the 4 rows to be imported. Is this a bug? ( I am using Web form) >Bharath, > >:( Mine is a web form. And I am using your line of code in my web form.. and still I am getting all the rows with the Pick List regardless if any rows are populated. > >Is there a bug in the Web form vs Win Form? > >>Hi, >> >>I am afraid.I was unable to reproduce the problem. Here is the code that I used for testing, >> >> >>sheet.ExportDataTable(10 (int firstrow),1 (int firstcolumn), (100 for eg.) sheet.UsedRange.End.Row (int maxrows), 1 (int >> >>maxcolumns),ExcelExportDataTableOptions.None); >> >> >>it exports 100 rows and 1 column(i.e from 10 to 109). >> >>and here is the sample that I used for testing: >> >>ExtractData.zip >> >> >>Please take a look at the attached sample and tell me if you still have the problem if so could you please modify the sample to >> >>reprodue the issus and send me, so that I can investigate further on this issue. >> >>Thanks, >>Bharath.


AD Administrator Syncfusion Team June 6, 2006 10:13 AM UTC

Hi Mia, I am able to reproduce this problem. However this has been fixed in our latest version 4.2.0.37. Please download our latest version through the following link. DownloadLink: http://www2.syncfusion.com/Installs/v4.2.0.37/SyncfusionEssentialStudioSetup.exe Note: This version requires a separate key to install. Please contact sales if you have not received a key. Please let me know if you have any other questions. Thanks, Bharath


AD Administrator Syncfusion Team June 6, 2006 09:29 PM UTC

Bharath...closer... I installed 4.2. This is the new behaviour. See file attached. My file has 21 Rows. Row 1-6 are header rows. I don''t need to import those. I need to import rows 9 to 21. (be advise...users can have more than this many rows) My code to exportdatatable: sheet.ExportDataTable(9, 1, sheet.UsedRange.End.Row, 9, ExcelExportDataTableOptions.None) What it is doing now is... populating my DataGrid with 21 Rows. Of those 21 Rows, only 13 rows have data. I want to only import in the 13 rows of data. Is my code wrong: sheet.ExportDataTable(9 (start), 1 (start), sheet.UsedRange.End.Row (end), 9 (end), ExcelExportDataTableOptions.None) ??? flustered... >Hi Mia, > >I am able to reproduce this problem. However this has been fixed in our latest version 4.2.0.37. > >Please download our latest version through the following link. > >DownloadLink: http://www2.syncfusion.com/Installs/v4.2.0.37/SyncfusionEssentialStudioSetup.exe > >Note: This version requires a separate key to install. Please contact sales if you have not received a key. > >Please let me know if you have any other questions. > >Thanks, >Bharath

T.zip


AD Administrator Syncfusion Team June 6, 2006 09:54 PM UTC

Barath.. found a workaround... sheet.ExportDataTable(9, 1, sheet.UsedRange.End.Row - 9, 9, ExcelExportDataTableOptions.None I think this will do it. the third parameter was - "max number of rows to get" Thanks >Bharath...closer... > >I installed 4.2. This is the new behaviour. See file attached. > >My file has 21 Rows. Row 1-6 are header rows. I don''t need to import those. I need to import rows 9 to 21. (be advise...users can have more than this many rows) > >My code to exportdatatable: >sheet.ExportDataTable(9, 1, sheet.UsedRange.End.Row, 9, ExcelExportDataTableOptions.None) > >What it is doing now is... populating my DataGrid with 21 Rows. Of those 21 Rows, only 13 rows have data. > >I want to only import in the 13 rows of data. Is my code wrong: > > >sheet.ExportDataTable(9 (start), 1 (start), sheet.UsedRange.End.Row (end), 9 (end), ExcelExportDataTableOptions.None) > >??? flustered... > > >>Hi Mia, >> >>I am able to reproduce this problem. However this has been fixed in our latest version 4.2.0.37. >> >>Please download our latest version through the following link. >> >>DownloadLink: http://www2.syncfusion.com/Installs/v4.2.0.37/SyncfusionEssentialStudioSetup.exe >> >>Note: This version requires a separate key to install. Please contact sales if you have not received a key. >> >>Please let me know if you have any other questions. >> >>Thanks, >>Bharath

T.zip

Loader.
Live Chat Icon For mobile
Up arrow icon