2010-11-25 15 views
15

का उपयोग कर ए 1 (सेल पता) का सेल मान कैसे प्राप्त करें मेरे पास एक्सेल सेल पता ए 1, ए 2 है। तो, कैसे प्रोग्राम के poi3.6 का उपयोग करapache poi 3.6

एक और तरीका

row=mySheet.getRow(); 
cell=row.getCell(); 

है लेकिन मैं A1 के प्रारूप में पता है ... हां, तो कैसे मैं उन सेल प्रोग्राम के

का उपयोग करते हैं इस सेल का उपयोग करने की

उत्तर

33
CellReference cr = new CellReference("A1"); 
row = mySheet.getRow(cr.getRow()); 
cell = row.getCell(cr.getCol()); 

अधिक नमूनों के लिए Quick Guide देखें।

+0

धन्यवाद Neeme ... – Saravanan

+1

@Saravanan के रूप में बदलने के चर 'अब': इतने पर शिष्टाचार "धन्यवाद" के लिए भी वोट दें करने के लिए है – JoseK

6

एक सेल रेफरेंस फ़ंक्शन

ईजी है

सेल रेफरेंस सेल रेफरेंस = नया सेल रेफरेंस ("बी 3");

(example यहां से ली गई)

0
using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Threading.Tasks; 

namespace test 
{ 
    class Program 
    { 
     static void Main(string[] ar) 
     { 
      // char a = 'A', b = 'B'; 
      //string[] ab = new string[100]; 
      //ab[0]= "A1"; 
      int k = 0, h = 0; ; 
      string ab = "B1"; 
      int l; 
      l = Convert.ToInt32(ab.Length.To String()); 

      for (int i = 0; i < l; i++) 
      { 
       if(!char.Is Digit(ab[i])) 
       { 
       for (int j = 65; j <= 90; j++) 
       { 
       if(Convert.ToInt32(ab[i])==j) 
        { 
         break; 
        } 
       else 
        { 
         k = 1-k; 
        } 

       } 

      } 
       else 
       { 
        h = (Convert.ToInt32(ab[i]))-49; 

       } 
       } 

      Console.Write Line(l); 
      Console.Write Line(h+""+k); 



     } 
    }} 

अपने एक्सेल सेल पता

संबंधित मुद्दे