Import data into local Excel and read local Excel into List

Source: Internet
Author: User

 Public classtestcasemanager{ Public Static FinalString title_caseid= "Test example ID";  Public Static FinalString title_casename= "Test Name";  Public Static FinalString title_testresult= "test Result";  Public Static FinalString title_testtime = "Test pass Time";  Public Static FinalString [] titles=NewString[]{title_caseid,title_casename,title_testresult,title_testtime};  Public Static voidGenerexcel (list<testcase>list, String path) {File File=NewFile (path); if(!file.exists ())              {Createexcel (List,path); }Else{List<TestCase>list2 readexcel (path); intlistnumber list2.size ();  for(inti=0;i<listnumber;i++) {TestCase TestCase=List2.get (i);                        List.add (testcase);                   } createexcel (List,path); }    }       Public Static voidCreateexcel (list<testcase>list, String path) {Hssfworkbook Workbook=NewHssfworkbook (); Format Format=NewSimpleDateFormat ("Yyyy-mm-dd"); String SheetName= Format.format (NewDate ()); Hssfsheet sheet=Workbook.createsheet (SheetName); Hssfrow Row=Sheet.create} Public StaticList<testcase>readexcel (String path) {}}

Import data into local Excel and read local Excel into List

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.