I have created an excel spreadsheet using epplus library.
In this spreadsheet there are few columns with drop downs.
I need to make these drop downs searchable. We can make a drop down applied on a single cell, searchable using excel functions.
But it is not possible to apply the same on all the cells within a column.
But this is achievable using excel add-ins like 'excel campus-the-list-search-add-in' ( https://members.excelcampus.com/products/the-list-search-add-in/categories/142180/posts/422610 ).
I don't want each and every user to install the excel add-in when they are using the spreadsheet created from my application.
I want the add-in to be automatically added, when creating the spreadsheet from my .NET application using epplus library.
Your question is a bit confusing! maybe this can help you:
//Create the data set and table
DataSet ds = new DataSet("New_DataSet");
DataTable dt = new DataTable("New_DataTable");
//Set the locale for each
ds.Locale = System.Threading.Thread.CurrentThread.CurrentCulture;
dt.Locale = System.Threading.Thread.CurrentThread.CurrentCulture;
//Open a DB connection (in this example with OleDB)
OleDbConnection con = new OleDbConnection(dbConnectionString);
con.Open();
//Create a query and fill the data table with the data from the DB
string sql = "SELECT Whatever FROM MyDBTable;";
OleDbCommand cmd = new OleDbCommand(sql, con);
OleDbDataAdapter adptr = new OleDbDataAdapter();
adptr.SelectCommand = cmd;
adptr.Fill(dt);
con.Close();
//Add the table to the data set
ds.Tables.Add(dt);
//Here's the easy part. Create the Excel worksheet from the data set
ExcelLibrary.DataSetHelper.CreateWorkbook("MyExcelFile.xls", ds);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.