ThienZ Posted March 13, 2005 Posted March 13, 2005 i fill a strongly typed dataset from excel, and then i write the sourcefilename, source sheet, and rownr into the columns filename, sheetname and rownr in the dataset. however excel takes takes the empty rows too into the dataset. like if the sheet has 100 active rows, but actually only the first 10 rows has values, the oledbdatadapter fill the dataset with these 100 rows and all the "cells" in the dataset in row 11-100 has (Null). i have some ideas : - before i write the filename, sheet, and rownr, i filter all the empty rows manually. i go through all rows and for each row i check the cell. if they are empty i delete them. but then i don't know anymore which row which rownr has (because there would be an empty row in the middle too) - after i write the filename, sheetname and rownr i go through all rows and for each row i transpose it, put it in a new dataset, sort it, and see if the 4th row has a value. if no then i can delete this row. does anyone has a better idea? (i'm sure there are many better ways.....) Quote
Moderators Robby Posted March 14, 2005 Moderators Posted March 14, 2005 You can transform your dataset using an XSLT file, in there you can format or exclude any row of your choosing. You can easily find better help elsewhere but this is a start ... http://www.w3schools.com/xsl/default.asp Quote Visit...Bassic Software
ThienZ Posted March 14, 2005 Author Posted March 14, 2005 i took a peek to w3school's xsl tutorial site, and i wonder if it would be easier if i filter the rows in xsl because i have 167 columns in this dataset i'm working on. and it seems that xsl is more likely for web purposes? i'm using dataset to work on excel sheets... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.