|
|
Great work,I have used in my WCF project
|
|
|
|
|
I need a function that writes a excel in a byte array instead of write in file. What i need change, i'm a noob and i don't unsderstand the process that's write the file if someone can help me?
|
|
|
|
|
Not sure what is the deal with Excel 2010 but if I try and open a xls created with this code excel throws and error when you try to open the file saying, "Excel found unreadable content in 'Newexcel.xls'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes".
It does not matter what you click, it never opens the file. I don't have any issues in 2007 or earlier versions of excel. Is there a workaround that anyone could share?
for reference here is the test code I am using to create the xls:
Workbook book2 = new Workbook();
Worksheet sheet1 = new Worksheet("Test1111");
sheet1.Cells[0, 1] = new Cell("this");
sheet1.Cells.ColumnWidth[0, 1] = 3000;
book2.Worksheets.Add(sheet1);
book2.Save("c:\\temp\\Newexcel.xls");
|
|
|
|
|
I have same issue also, anyone can help?
|
|
|
|
|
With Excel 2007 there was a problem opening a file when the result file size was under 7kb, so when creating a file from a dataset I have added some dummy rows when the data amount was too small, something like this
' Add dummy rows to the existing dataset
For i As Integer = 1 To 20
Dim newDummyRow As DataRow = ds.Tables(0).NewRow()
newDummyRow(0) = " "
ds.Tables(0).Rows.Add(newDummyRow)
Next i
' Create a file from dataset
ExcelLibrary.DataSetHelper.CreateWorkbook(strFilename, ds)
|
|
|
|
|
I also faced problem. This helped. Thanks a lot
|
|
|
|
|
When print previewing or printing the generated excel file, I got this error message,
"Microsoft Office Excel did not find anything to print."
Any idea what the problem is?
|
|
|
|
|
How does one merge cells using this library?
|
|
|
|
|
Hi, I have a problem. I am trying to read a xls file. On my local machine everything works fine, but when i test it on a server i get this error "An item with the same key has already been added" on this line "book.Open(fileStream);"
I hope someone can help me, and sorry for my bad english :$
Here is the Stack Trace:
[ArgumentException: An item with the same key has already been added.]
System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +51
System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +2628449
System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +11
QiHe.Office.Excel.MsofbtDgg.Decode() in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Extended\MsofbtDgg.cs:25
QiHe.Office.Excel.MsofbtContainer.Decode() in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Extended\MsofbtContainer.cs:19
QiHe.Office.Excel.MSOCONTAINER.Decode() in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Extended\MSOCONTAINER.cs:19
QiHe.Office.Excel.Workbook.DecodeRecords() in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Workbook.cs:103
QiHe.Office.Excel.Workbook.Read(Stream stream) in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Workbook.cs:43
QiHe.Office.Excel.Workbook.Open(Stream file) in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ExcelReader\Office\Excel\Workbook.cs:37
System.Harweb.Utilidades.ClsFiles.GetExcelData(String filePath, String tableName) in C:\DDisk\Harweb.net HWD\Dynamic Linked Libraries\Generales\System.Harweb.Utilidades\System.Harweb.Utilidades\ClassFiles.cs:96
perfilxls.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Harweb_SESA\harweb\1131\mov\movlab\dinamico\cargar\perfilxls.aspx.cs:78
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
|
|
|
|
|
Hi,
I have read in an existing spreadsheet and need to insert a column in postion 0 (first column).
Is there anyway to do this?
The method i tried just overwrites the read in data.
Thanks
Scott.
modified on Tuesday, August 25, 2009 9:58 AM
|
|
|
|
|
I couldnt find a way to do it so added this method to the row class:
public void InsertColumn(int colIndex, Cell cell)
{
for(int i=LastColIndex; i >= colIndex; i--)
{
Cell tempCel = GetCell(i);
SetCell(i + 1, tempCel);
}
SetCell(colIndex, cell);
}
Feel free to include this in the next release as i think its a needed feature.
Thanks
Scott
|
|
|
|
|
Hi
this is a great project, nice job Liu
but I have a little problem, when I modify a file and when I save it I lost all the formulas present in the file and in the cells where there were the formulas I found only the value, this is the code that I use:
Workbook book = Workbook.Open(txtSource.Text);
Worksheet sheet = book.Worksheets[0];
sheet.Cells[0, 0] = new Cell("Test");
book.Save(txtDestinazione.Text);
I wrong something or anything else?
Thanks
|
|
|
|
|
The code works as rewritting the whole file. Formatting styles, formulas and other unsupported features are not preserved.
I am happy to work with people doing great projects.
|
|
|
|
|
Hi Liu
Nice work on the library, I was wondering how do you create a hyperlink to a relative path in a cell.
Cheers Mick
|
|
|
|
|
|
Huh?? This libray does not use interop, ergo Excel is not required to be installed on the client machine.
|
|
|
|
|
Could anyone give me a little code-sample on how to get the markup for a cell (fonts, border, color etc).
I'm trying to get it running in ASP.NET (C#), but I cannot seem to get it right.
Thanks in advance,
K. van der Werf
|
|
|
|
|
I am also looking for a solution on how to do this.
|
|
|
|
|
I am new to the boards- but I don't see a solution for this. Is there any example or quick place in the documentation to see how to adjust the color, font etc. of a given cell? I see that it is in Format, but I don't seem to be doing something right.
thanks,
-scott
|
|
|
|
|
Exception of type 'System.OutOfMemoryException' was thrown.
at
this.MasterSectorAllocationTable = new List<int>(NumberOfSecIDs);
The number of sector IDs is 1836592733. Is that to big for an int?
Michael S. Flynn
|
|
|
|
|
I am writing an extra row to an existing Excle spreadsheet and after writing the file I try to reopen the file and receive an error:
EndOfStreamException was unhandeld
Unable to read beyond te end of the stream;
When I open the file in Excel and save it with Excel I am able to open it with my program again.
Any idea why this is happening?
|
|
|
|
|
Hello,
first thanks for a nice project.
What would be the easiest way to directly encode a Workbook object to the Output-stream of a Html webpage Response object without needing to first save the information to file.
E.g. The user uploads an Excel file with some information that is processed and added to by the server which than should return the information to the user by letting them decide where to save the new/modified file.
Any idea about the best/easiest way to accomplish this?
Best regards,
Henrik
|
|
|
|
|
Implemented by r47. You can use Workbook's Save(Stream stream) method.
I am happy to work with people doing great projects.
|
|
|
|
|
I am able to generate the excel with my Webpage using the following codes. The file download dialog will be shown and user can save the file on desktop.
When I open the file, it displays this message "Lost document summary information.". But the file appear correct as it contains all data and worksheets. Any idea what could be the reason? Being trying all ContentType, Response method, but none seems to be able to remove that error message.
Thanks.
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;filename=excelfile1.xls");
WorkbookEncoder.Encode(workbook, Response.OutputStream);
Response.End();
|
|
|
|