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
การสร้าง Crystal Report กับ DataSet หรือ DataTable (VB.NET,C#)
การสร้าง Crystal Report กับ DataSet หรือ DataTable (VB.NET,C#)
บทความนี้ Advanced ขึ้นมาอีกนิดสำหรับการสร้าง Report ของ Crystal Report กับ DataSet หรือ DataTable ของ .NET Framework
Rating :
Update :
2017-03-24 21:28:46 View : 127,453
ออกรายงาน Crystal Report บน Web(ASP.NET) Step by Step
ออกรายงาน Crystal Report บน Web(ASP.NET) Step by Step
ตัวอย่างการออกรายงานบน crystal report บนเว็บ web(asp.net) อธิบายขั้นตอนทีล่ะ step เข้าใจง่าย ทำงานได้จริง
Rating :
Update :
2017-03-17 21:19:24 View : 63,380
VB.NET/C# Login Check Username Password
VB.NET/C# Login Check Username Password
สร้างระบบล็อกอิน Login Form ตรวจสอบสิทธิ์ของ Username และ Password ก่อนจะเข้าสู่โปรแกรม
Rating :
Update :
2012-02-27 13:25:22 View : 26,447
.NET Parameterized Queries
.NET Parameterized Queries
.NET Parameterized Queries
Rating :
Update :
2017-03-24 21:20:12 View : 11,128
สร้าง Sub Report (Subreport) บน Crystal Report แบบ Step by Step (VB.NET /C#)
สร้าง Sub Report (Subreport) บน Crystal Report แบบ Step by Step (VB.NET /C#)
การสร้าง Sub Report บน Crystal Report และการ Link ข้อมูลระหว่าง Main Report กับ Sub Report รวมทั้งการ Set DataSource ให้กับ Sub Report
Rating :
Update :
2017-03-24 21:34:46 View : 55,278
Install .NET Framework 2.0 & Visual Studio 2005
Install .NET Framework 2.0 & Visual Studio 2005
Install .NET Framework 2.0 & Visual Studio 2005 ติดตั้งและใช้งาน .NET Framework 2.0 และ VS 2005
Rating :
Update :
2009-01-11 09:44:53 View : 9,162
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 อัตราราคา คลิกที่นี่