Quantcast
Viewing all 637 articles
Browse latest View live

New Post: Number of columns

How do I get number of sheet's columns?

New Post: How can I change the long date format to short date format?

Thanks 540YMX

it works fine for me.

New Post: How to read active-x control in excel using NPOI

HI.........

I have a active-x checkbox control in my excel. I need to read the value of the active-x control i.e. the checkbox on the server...on my local machine as excel component is installed there is no issue to read the same but at the server there is no excel component installed.


Is there any way i can read the active-x check control without using ole-db or excel component at the server...

Following is the code i am using
        DataTable dt = new DataTable();
        HSSFWorkbook hssfworkbook;
        StringBuilder sb = new StringBuilder();
        using (FileStream file = new FileStream(FileName, FileMode.Open, FileAccess.Read))
        {
            hssfworkbook = new HSSFWorkbook(file);
        }
        int SheetCount = hssfworkbook.NumberOfSheets;

        for (int Loopvar = 0; Loopvar < 4; Loopvar++)
        {
            ISheet sheet = hssfworkbook.GetSheetAt(Loopvar);
            System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
            while (rows.MoveNext())
            {
                IRow row = (HSSFRow)rows.Current;
                for (int i = 0; i < row.LastCellNum; i++)
                {
                    ICell cell = row.GetCell(i);
                    if (cell == null)
                    {
                        sb.Append("");
                        sb.Append("Æ");
                    }
                    else
                    {
                        sb.Append(cell.ToString());
                        sb.Append("Æ");
                    }
                }
                sb.AppendLine();
                //sheet = null;
            }
        }    
        return sb.ToString();
But when check box is there in the cell it is returning null value.....


Thanks in advance.....

New Post: NPOI 2.0 Source Code

New Post: Excel Conversion to PDF using NPOI

PDF is totally out of scope of NPOI. sorry

New Post: How to read active-x control in excel using NPOI

ActiveX control is not supported in NPOI

New Post: XSLX Sheet ShiftRows, RemoveRow doesn't update LastRowNum

Hi All!

ISheet has ShiftRow, RemoveRow method.
HSSFSheet after each row operation recalc LastRowNum value.
XSSFSHeet recalc LastRowNum only after CreateRow operation triggers.

How manualy recalc LastRowNum in XSSFSheet?

That's needed when new RowNumber > LastRowNumber. In HSSFSheet use can compare LastRowNum with new RowNum to prevent error. In XSSFSHeet can't.

NPOI 2.0 beta 1
.Net 4.0

Thanks.

New Post: How to disable the console output for XSSFWorkbook

Hi,
I'm using the XSSFWorkbook object in my console application, and when I run my application, I see text (as below) is written in the console during the Excel object composing.

NPOI.XSSF.Model.SharedStringsTable
NPOI.XSSF.Model.StylesTable
NPOI.XSSF.UserModel.XSSFSheet

How to disable the displaying of this text to the console..?

Thanks
Hisham

New Post: How to disable the console output for XSSFWorkbook

I found a solution.
Before the declaration of XSSFWorkbook object configure the console output to be:

var consoleOut = new StringWriter();
Console.SetOut(consoleOut);

When you finish with the Excel object, revert the console output again to be:

var stdOut = Console.Out;
Console.SetOut(stdOut);



Cheers,
Hisham

New Post: XLS file created from template doesn't save correctly - any ideas?

It's suggested that you directly use xls as the template. xlt file is never tested by NPOI test cases. I'm not sure if the structure is same or not.

New Post: Error while reading .doc file

XWPF is for docx instead of doc. To read doc, you have to use code in ScratchPad. The namespace is called HWPF. But HWPF is not included in official release because it's not stable yet.

New Post: 修改xlsx文件后保存会丢失数据和格式

请上传你的xlsx文件,谢谢。

New Post: XSLX Sheet ShiftRows, RemoveRow doesn't update LastRowNum

It's a bug in XSSFSheet.ShiftRow.

New Post: XLS file created from template doesn't save correctly - any ideas?

Thanks Tonyqus.

We are re-writing an existing application, and the upstream systems provide templates in xlt format. Therefore we have to stick with XLT unfortunately.

Aspose.Cells can handle xlt files, so we may proceed down that route for this part of the system.

Cheers,
Matt.

New Post: 修改xlsx文件后保存会丢失数据和格式

我也碰到同样的问题,xlsx附件怎么上传

New Post: XSSF Performance: degrade when creating huge number of rows

Is a new version going to be released anytime soon? I'm experiencing major performance issues when using XSSF to generate a xlsx spreadsheet.

Thanks.

New Post: html converter

Dear All,

I am using the html converter included in the examples folder. However, it is converting all the worksheets into a single html.
  1. Is there a way to convert only one worksheet instead of a workbook?
  2. Secondly, the example seems to work only with xls files. If it possible to do the conversion also for xlsx files?
Thanks a lot,
Prasad..

New Post: Turn off Transition Formula Evaluation

Hi, when i export using the example CreateEmptyExcelFile. I have noticed "transition formula evaluation" is checked by default export.

You can see this value by going to
Excel options > Advance >
and it's at the bottom.

Having this value checked is causing issues for me, can it be disabled?

Namely, the issue is when exporting a Date, if you F2 to edit the date, then push escape, the date will change to 1900/01/01. I believe this is because of this transition formula evaluation.

Many thanks,

New Post: Turn off Transition Formula Evaluation

The solution was in the latest examples, i must have been using an older version.

((HSSFSheet)hssfworkbook.GetSheetAt(0)).AlternativeFormula = false;
((HSSFSheet)hssfworkbook.GetSheetAt(0)).AlternativeExpression = false;

New Post: Out of Memory Error - while writing to Excel using Xssfworkbook

Is there any alternate way to get rid of this using existing dll???
Viewing all 637 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>