How To Freeze The Header Row In An Excel Spreadsheet
Feb 25, 2010
I'm exporting an ASP.NET gridview to Excel using the following function. The formatting is working really well, except I need to freeze the header row in Excel on the export. I'm really trying to avoid using a 3rd party Excel plugin for this, but unless there's some archaic excel markup in my AddExcelStyling function.
I would like to know how I can freeze the Header Row using DataGrid with AJAX in IE8. I've already tried using CSS but this does not work with IE8 unless I switch it to compatiblity mode. I have more than 100+ users so this is not feasible.
I have a grid view that contains a lot of data. Users have to scroll down far sometimes to edit that data. But since the header of the gridview isn't inherently frozen, its a pain for them to edit that data because they have to constantly scroll up and down. I've looked up several different methods on how to freeze the columns, but it none work work well with bound data. Often times, the rows will be offset by a large margin and even greater so, when the data is being edited. So it beats the purpose of doing it.
Any better way to freeze columns? I see alot of examples on the net using css but they use expression which has been deprecated.
Possible Duplicate: Create Excel (.XLS and .XLSX) file from C#
I have some code that generates a zip file that contains multiple CSV files and streams it back to the user (no file is saved on the server). However, I want to create an excel workbook instead (can be traditional xls or Office Open XML xlsx format) with each CSV 'file' being a spreadsheet.
How can I do this, without resorting to Office Automation on the server or a commercial 3rd party component?
I have searched numerous articles for how to accomplish freezing the Header Row of a DataGrid or GridView component being to simply hide the header and then build table cells just above the component to define the columns. But the one that I'd like to get to work is by the use of CSS code. Problem is that this code seems to work for everyone else but it isn't working for me. Here's my Stylesheet code:
When I run my page I get all the styles applied but the header scrolls with all the other rows in the grid.
why this code is probably not working? I am using .NET Framework 3.5 and developing in VSS 2008 which may be why this doesn't work?
I have successfully downloaded sample code from Code Project which works using other techniques as well, but the code was written in .NET 1.1 Framework and VB.NET.
I'm working on a project which requires me to plot a graph using Visual Studio ASP.Net from a data I've collected either in .txt or .xml format. The data consist of, eg. 15 records, but I'm only needed to plot 8 graphs out of the 15 records.
I'm trying to upload an excel spreadsheet using the FileUpload control, read the excel sheet using OleDb connection, and save the strings onto a sql server database.Then, I'm trying to read each string in another method.My web app is currently hosted on the network on my local box, and using savePath= @"C:desktop" like I had it previously wasn't working, so I figured using a sql server database would work for being able to save the file and open it again... but I'm getting confused on how to do so, so i tried using my old savePath but it's not working anymore. So... I'm really at a lost on what to do and how to fix it.
On an .aspx page in a web site I need to retrieve some data from a sql server database and, instead of displaying it in a Gridview, I need to put the data in a spreadsheet and present the user with a Save As dialog.
I'd prefer to do it without using the Office / Excel / Interop com object - so, from what I've read so far, I can do this by returning XML data from SQL Server?
Normally I get data from SQL Server and populate a dataset or datareader with it - and then use this as the Datasource of a GridView.
If I run this in SQL Server ...
Code: SELECT UserID, UserName FROM tblUsers FOR XML Auto, Root('Users')
So, first question - how do I get the data from SQL Server into my .aspx page? (All data access is done with stored procedures - so, from my data access class normally I create, for example, a SQLDataReader and populate it by calling a stored procedure. What object would I populate with the results of a stored procedure that contains a select statement with 'FOR XML Auto'
Then, assuming I get the XML into the .aspx page - how do I get it into a spreadsheet so that there are two columns called UserID and UserName and 3 rows with 1, 2 and 3 in the first cell and Steve, Andrea and Zebedee in teh second cell?
I have a gridview Control. In that control I need to show the headers when gridview is scrolling verticall. I tried your post from here [URL].... It's working in page loads.When I try to click any other buttons it's not working(it's showing all the records. I mean It's not scrolling). I have Add, Delete and reset buttons.
My company has new customers in Brazil and we realized that our excel reports are not working when our Brazilian customers tried to open the reports in their Brazilian versions of excel.
For excel output we use spreadsheet gear in our vb.net web application. Our excel worksheets are fairly simple. Mostly outputted text/numbers/dates, a couple of formulas (sum, if) and formatting on the currency and dates.
I've tried several methods to get my excel reports to work: First I left the excel workbook in the "en-US" culture and tried simply chaging the number format for Brazil to:
And this formatted the regular cells but the formulas still failed to show a value. Instead they showed a 0 value.
Next I tried changing the workbook to the "pt-BR" culture and that also forced me to translate the formula names (Sum -> Soma, If -> Se) but they still wouldn't should a value and instead showed a #Name/#Nome error. Interestingly enough the formulas would work if I edited the cell and hit enter. The formula wouldn't change but it would some how fix that cell.
I need to be able to out excel reports that can format dates/currencies and apply simple formulas (IF, Sum) for other excel cultures.
I would like to access an Excel 2010 spreadsheet via ASP.NET 4 - what is the best (i.e. straight forward) method to do this? I would like to update the spreadsheet via ASP then read the results of the data from Excel back to a web form.
I would like to be able to copy one row and five columns from an Excel spreadsheet to a table like structure on a ASP.NET web form. The idea is keeping the data in the exact row and column from Excel to the table like control on the ASP.NET web-form. Then I want to be able to save to the contents of the ASP.NET control to a database by a buttoon command click. What ASP.NET control would allow me to do this? Gridviews and datagrids don't seem to allow me to do this.
I want to show information from an excel spreadsheet in a web page. The xls will have maybe 5 columns, and as many rows as needed. The columns will be 'Name', 'Created Date', 'Expired Date', 'Owner', and maybe down the road maybe more.
What I would like is for the C# to nightly read the xls, and display the information in a table on the website.
If there is a PDF available for download I am going to link that as well.
I am trying to generate an excel spreadsheet in my vb.net web service but it looks like its not allowing me. I need to generate it from xml string and send this spreadsheet in an email from the same web service.