Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

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

$
0
0
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.....

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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