Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > Java Programming > Java Forum > สร้างรายงานออกทาง excel ตอนนี้กำลังสร้างเว็บโดยใช้ jsp อยู่ค่ะ แล้วต้องการดึงข้อมูลจากฐานข้อมูลมาแสดง


 

[Java] สร้างรายงานออกทาง excel ตอนนี้กำลังสร้างเว็บโดยใช้ jsp อยู่ค่ะ แล้วต้องการดึงข้อมูลจากฐานข้อมูลมาแสดง

 
Topic : 030248



โพสกระทู้ ( 23 )
บทความ ( 0 )



สถานะออฟไลน์



ตอนนี้กำลังสร้างเว็บโดยใช้ jsp อยู่ค่ะ แล้วต้องการดึงข้อมูลจากฐานข้อมูลมาแสดง แต่ว่ามันมีหลายคอลัมน์มาก
เลยอยากให้แสดงในexcel อะค่ะ พอมีวิธีแนะนำมั้ยคะ
ไม่จำเป็นต้องเกี่ยวกับjspก็ได้นะคะ เดี๋ยวไปพยายามดัดแปลงเองค่ะ
ขอบคุณค่ะ



Tag : - - - -

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2009-08-13 10:40:20 By : nui_dinga View : 2619 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

PHP Write Excel (Excel.Application)

ลองดูน่ะครับ เผื่อจะช่วยได้
Date : 2009-08-13 11:20:32 By : webmaster
 

 

No. 2



โพสกระทู้ ( 1,528 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


Code
01.fileIn = new FileInputStream("D:/programjava/new_auto_recon2009_age/Auto_Recon.xls");
02.      wb = new HSSFWorkbook(fileIn);
03.       
04.          try{                       
05.                  sheet = wb.getSheetAt(0);
06.                  HSSFCellStyle cellStyle = wb.createCellStyle();
07.                  HSSFDataFormat cellFormat = wb.createDataFormat();
08.                  HSSFFont cellFont = wb.createFont();
09.                  cellFont.setFontHeightInPoints((short)8.5);
10.                  cellFont.setFontName("MS Sans Serif");
11.                  cellStyle.setFont(cellFont);                                                     
12.                  intRow = 3;                       
13.                  strReportDate = PublicFunction.changeFormatDate(ReportDate);
14.                   
15.                  for (Iterator iter = repTsdProfiles.iterator(); iter.hasNext();) {
16.                      TsdProfileInf repTsdProfile = (TsdProfileInf) iter.next();
17. 
18. 
19.                          row = sheet.getRow(intRow);
20.                           
21.                          cell = row.getCell((short)1);
22.                          if (cell == null)
23.                              cell = row.createCell((short)1);
24.                          cell.setCellValue(strReportDate);
25.                          cell.setCellStyle(cellStyle);
26.                           
27.                          cell = row.getCell((short)2);
28.                          if (cell == null)
29.                              cell = row.createCell((short)2);                                         
30.                          cell.setCellValue(repTsdProfile.getSecSymbol());
31.                          cell.setCellStyle(cellStyle);
32.                           
33.                          cell = row.getCell((short)3);
34.                          if (cell == null)
35.                              cell = row.createCell((short)3);
36.                          cell.setCellValue(repTsdProfile.getIsin());
37.                          cell.setCellStyle(cellStyle);
38.                          //cell.setEncoding(cell.ENCODING_UTF_16);
39.                           
40.                          cell = row.getCell((short)4);
41.                          if (cell == null)
42.                              cell = row.createCell((short)4);
43.                          cellStyle.setDataFormat(cellFormat.getFormat("#,##0.00"));                               
44.                          cell.setCellValue(repTsdProfile.getBalQuantity());   
45.                          cell.setCellStyle(cellStyle);
46. 
47.                          cell = row.getCell((short)5);
48.                          if (cell == null)
49.                              cell = row.createCell((short)5);
50.                          cell.setCellValue(repTsdProfile.getPc());   
51.                          cell.setCellStyle(cellStyle);
52.                           
53.                          cell = row.getCell((short)6);
54.                          if (cell == null)
55.                          cell = row.createCell((short)6);
56.                          //cellStyle.setDataFormat(cellFormat.getFormat("#,##0.00"));                               
57.                          cell.setCellValue(repTsdProfile.getPenSecdil());   
58.                          cell.setCellStyle(cellStyle);
59. 
60.                           
61.                          intRow++;
62.                  }                 


เขียนลง excel เลย ลองดูนะครับ
Date : 2009-08-13 11:36:02 By : Sek-Artdrinker
 

 

No. 3

Guest


ใช้ mysql สิ เชื่อมโยงกับ jsp
Date : 2011-12-14 00:21:06 By : นีน่า
 

 

No. 4



โพสกระทู้ ( 0 )
บทความ ( 0 )



สถานะออฟไลน์


JSP and Excel (Java)

Date : 2013-10-06 07:47:09 By : tc
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สร้างรายงานออกทาง excel ตอนนี้กำลังสร้างเว็บโดยใช้ jsp อยู่ค่ะ แล้วต้องการดึงข้อมูลจากฐานข้อมูลมาแสดง
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่