top
logo

ចំនួនអ្នកទស្សនា

033331
Today89
Yesterday130
This Week592
This Month1166
All Days33331
38.107.191.85
US


លេខទូរស័ព្ទសង្គ្រោះបន្ទាន់ មន្ទីរពេទ្យសាធារណៈនៅភ្នំពេញ
d

១. រថយន្តសាមុយ មន្ទីរពេទ្យ​កាល់ម៉ែត= 119
២. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​រុស្ស៊ី= 023 217 764
= វិទ្យុទាក់ទង (151940)
៣. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​ព្រះសង្ឃ= 016 909 774
៤. លេខប្រចាំការ (Hot Line) គ្រុនផ្ដាសាយ A(H1N1)= 012 488 981
= 012 836 868

Export Data from VB 2008 to Excel បោះពុម្ភ  សារអេឡិចត្រូនិច
សរសេរដោយ Setha IECH   
ពុធ, 19 ឧសភា 2010 08:41

Private Sub btnExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcel.Click

Dim ExcelApp As Object, ExcelBook As Object
Dim ExcelSheet As Object
Dim i As Integer
Dim j As Integer

'create object of excel

ExcelApp = CreateObject("Excel.Application")
ExcelBook = ExcelApp.WorkBooks.Add
ExcelSheet = ExcelBook.WorkSheets(1)

With ExcelSheet
    For i = 1 To Me.DataGridView1.RowCount
         .cells(i, 1) =
Me.DataGridView1.Rows(i - 1).Cells("id").Value
        
For j = 1 To DataGridView1.Columns.Count - 1
              .cells(i, j + 1) = DataGridView1.Rows(i - 1).Cells(j).Value
        
Next
   
Next
End With

ExcelApp.Visible = True
'set page margin
ExcelSheet.PageSetup.PaperSize = 9
ExcelSheet.PageSetup.LeftMargin = ExcelApp.InchesToPoints(0.3)
ExcelSheet.PageSetup.RightMargin = ExcelApp.InchesToPoints(0.3)
ExcelSheet.PageSetup.TopMargin = ExcelApp.InchesToPoints(0.3)
ExcelSheet.PageSetup.BottomMargin = ExcelApp.InchesToPoints(0.3)

ExcelSheet.PageSetup.CenterHorizontally = True

'
ExcelSheet = Nothing
ExcelBook = Nothing
ExcelApp = Nothing

End Sub

Download Source Code Here

 

bottom
top
bottom

ផលិតដោយ krookroo.com.