I'm trying to export data from an asp.net page to an Excel file and I'm basically just outputting HTML to the XLS file and let Excel interprets it, by using this type of coding:
Although this is doing fine for exporting raw text, I now have to export to the same Excel file an image. However, the same kind of method I'm using right now only seems to insert a "linked" image, I mean, the image appears in the file, however, the user viewing the file has to be online since it's a direct link to the file in the server. I would like to able to "embeded" the image in the file, just like how it's made when you insert manually an image using Excel.
However, after some online research I can't seem to find any solution for this.
I can't use Microsoft.Office.Interop.Excel library, and a third party software isn't advisable also, that's what made me try out the HTML output solution, which worked ok for the text. But now, for inserting an image, what can I do? Is it possible to achieve what I pretend?
I have a code that export a gridview to excel file But I have a problem with images since the sort direction is an image and when I export the gridview to excel I got X at the excel file in place the Sort Direction at the header It look that it loss the path to the image.
i have different tables for product details, images, category mapping
is there any way to import/export products by excel file in database along with category mappying and pictures in one go rather that importing just the products and then categorizing each product and adding image one by one ?
I need to export SQL query results to an Excel file.
I use the following code to do it.
Works fine for majority of the cases. There is a column called Description in the query results which is of type nText in the sql database. This can have lengthy data ( couple fo paragraphs) . When the number of charcters are large only the first portion of the data is showed and it trims the rare portion. how I can avoid this? Or any efficient code example on how I can do this in a different manner
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Me.IsPostBack Then Dim dataSet1 As New DataSet dataSet1 Dim dataSet2 As New DataSet dataSet2 Dim dataSet3 As New DataSet dataSet3
Dim dataSets As New List(Of DataSet)() dataSets.Add(dataSet1) dataSets.Add(dataSet2) dataSets.Add(dataSet3) Dim strout As String = Server.MapPath("test1.xls") DataSetsToExcel(dataSets, strout) End If End Sub
How to create each excel sheet non-editable (read only)
I have a file pdf, in file pdf of me has a table with many columns. How to Fill data from file pdf to columns of file Excel?I want fill data from file table of file pdf to file excel following format of file pdf.
I am using asp.net oledb to export information to excel file. I encounter problems when the information to export becomes too big, in this case the code I have given below, the excel file generated becomes an empty spreadsheet. If I changed the loop to 1123 for insertion of the rows. The generated excel file is fine, 1125 rows, and 4 columns shown. A test program in windows form is also working fine regardless of how many rows. Code has been simplified, "information ..." in the sql insertion command represents 1803 characters.
ExcelObjConn = "Provider=Microsoft.Ace.OLEDB.12.0;" & _ "Data Source=" & fileName & ";Extended Properties=Excel 12.0 XML" ExcelConnection = New System.Data.OleDb.OleDbConnection(ExcelObjConn) ExcelConnection.Open() Try SqlCommand = "CREATE TABLE ABC ([row1] text, [row2] text, [row3] text, [row4] text)" ExcelCommand = New OleDb.OleDbCommand(SqlCommand, ExcelConnection) ExcelCommand.ExecuteNonQuery() ExcelCommand.Dispose() For i As Integer = 0 To 1124 SqlCommand = "Insert into ABC ([row1], [row2], [row3], [row4]) Values ('information...', 'information ...', 'information ...', 'information ...')" ExcelCommand = New OleDb.OleDbCommand(SqlCommand, ExcelConnection) ExcelCommand.ExecuteNonQuery() ExcelCommand.Dispose() Next Catch ex As Exception Finally If ExcelConnection IsNot Nothing Then ExcelConnection.Close() ExcelConnection.Dispose() End If End Try
I couldn't find a solution to my problem as well. What I did eventually was to run the process using another separate windows service. The code works perfectly fine running from a windows form or service program, but not asp.net, not sure why.
We have the requirement to export the data from the grid excel. We can't install the Excel on the server. The excel generated need to be in the printable format. The excel generated needs to have custom headers, footers, repeatble rows, columns and landscape / portrait orientation style.