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 > .NET Framework > Generating Excel Report in .NET Framework



Generating Excel Report in .NET Framework

 
  Generating Excel Report in .NET Framework สร้างเอกสาร Microsoft Excel (.xls) ง่าย ๆ บน Windows Application และ Console Application ด้วย Framework (VB.NET)

1. สร้าง Windows Application หรือ Console Application

.NET 2.0 & Excel



2. Add Library ของ Excel

.NET 2.0 & Excel

3. Code ในโปรแกรม

Code (VB.NET)
Dim FileName As String = "MyExcel.xls"
        '*** Create Excel.Application ***'
        Dim xlApp As New Microsoft.Office.Interop.Excel.Application
        Dim xlSheet1 As Microsoft.Office.Interop.Excel.Worksheet
        Dim xlBook As Microsoft.Office.Interop.Excel.Workbook

        xlBook = xlApp.Workbooks.Add()

        '*** Create Sheet 1 ***'
        xlSheet1 = xlBook.Worksheets(1)
        xlSheet1.Name = "My Sheet1"
        xlApp.Application.Visible = False

        '*** Write text to Row 1 Column 1 ***'
        With xlApp.ActiveSheet.Cells(1, 1)
            .Value = "ThaiCreate.Com"
        End With

        '*** Write text to Row 2 Column 2 ***'
        With xlApp.ActiveSheet.Cells(2, 2)
            .Value = "Mr.Weerachai Nukitram"
        End With


        '*** Save Excel ***'
        'xlSheet1.PrintOut 1 '*** Print to printer ***'
        xlSheet1.SaveAs("C:\" & FileName)
        xlApp.Application.Quit()
        xlApp.Quit()

        '*** Quit and Clear Object ***'
        xlSheet1 = Nothing
        xlBook = Nothing
        xlApp = Nothing


Output

.NET 2.0 & Excel




การใช้งานคำสั่งอื่น ๆ สามารถอ่านได้ในบทความ ASP.NET & Excel


อืม แล้วก็แนะนำการทำ ASP.NET & Excel Charts ด้วยครับ




       
Bookmark.   
       

 

  By : TC Admin
  Score Rating : -
  Create Date : 2009-01-14 15:58:24
  Download : Download  Generating Excel Report in .NET Framework (0.32 MB)
     


Related Links
Install .NET Framework 1.1 & Visual Studio .NET 2003
Install .NET Framework 1.1 & Visual Studio .NET 2003
Install .NET Framework 1.1 & Visual Studio .NET 2003 ติดตั้งและใช้งาน .NET Framework 1.1 และ VS 2003
Rating :
Update :
2009-01-11 09:41:25 View : 7,129
ASP.NET เรียก PHP กับฐานข้อมูล MySQL ผ่าน Web Service และการรับส่งค่าผ่านเว็บเซอร์วิส
ASP.NET เรียก PHP กับฐานข้อมูล MySQL ผ่าน Web Service และการรับส่งค่าผ่านเว็บเซอร์วิส
การสร้างเว็บเซอร์วิสด้วย php กับฐานข้อมูล mysql และทำการเรียก web service ด้วย asp.net ซึ่งอยู่ในฝั่ง client โดยทำการรับส่งข้อมูลระหว่าง php กับ asp.net
Rating :
Update :
2017-03-17 21:21:37 View : 17,550
Basic jQuery for AJAX in ASP.NET Web Site พื้นฐาน Ajax กับ ASP.NET ด้วย jQuery
Basic jQuery for AJAX in ASP.NET Web Site พื้นฐาน Ajax กับ ASP.NET ด้วย jQuery
บทความ jQuery กับการใช้งาน Ajax บน ASP.NET Framework ทำความเข้าใจพื้นฐานการทำงานกับ Ajax ด้วย jQuery กับ ASP.NET แบบง่าย ๆ เบสิก
Rating :
Update :
2017-03-24 21:23:54 View : 22,240
C# .NET Generate Excel (Windows 7 and Office Excel 2003 , Excel 2007 , Excel  2010)
C# .NET Generate Excel (Windows 7 and Office Excel 2003 , Excel 2007 , Excel 2010)
ตัวอย่างการใช้ C# ในการสร้างเอกสาร Excel (.xls) โดยใช้ Class Library ของ Microsoft.Office.Interop.Excel
Rating :
Update :
2017-03-24 21:21:31 View : 31,654
ASP.NET แสดงรูปภาพ Image บน Crystal Report แบบ Step by Step (VB.NET / C#)
ASP.NET แสดงรูปภาพ Image บน Crystal Report แบบ Step by Step (VB.NET / C#)
บทความการแสดง Image รูปภาพบน Crystal Report โดยใช้การดึง Path รูปภาพที่ถูกจัดเก็บไว้ที่ SQL Server และอ่านรูปภาพที่อยู่ในโฟเดอร์ แบบ Binary
Rating :
Update :
2017-03-24 21:35:36 View : 35,298
GridView Ajax and jQuery การสร้าง GridView  บน ASP.NET เพื่อเรียกใช้งาน Ajax กับ jQuery
GridView Ajax and jQuery การสร้าง GridView บน ASP.NET เพื่อเรียกใช้งาน Ajax กับ jQuery
ASP.NET ตัวอย่างการสร้าง GridView และการเรียกใช้งาน Ajax ด้วย jQuery เพื่อเรียกข้อมูลในแต่ละแถวของ GridView แบบง่าย ๆ
Rating :
Update :
2017-03-24 21:30:30 View : 16,979
ThaiCreate.Com Forum
Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   





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 อัตราราคา คลิกที่นี่