تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تصدير DataGridView الى xls
#11
هذه الامور يمكن التحكم بها بالداتاغريد فيو قبل عملية التصدير .
الرد }}}
تم الشكر بواسطة:
#12
رغم التحكم ما زال يعض تاريخ طويل به الزمن
ومش عارف احل المشكلة
الرد }}}
تم الشكر بواسطة:
#13
جرب هذا الكود ليتحكم بتنسيق التاريخ في الداتا غريد فيو :

PHP كود :
    '++++++++++++++++++++++++++++'
    'تنسيق التاريخ DataGridView1'
 
   Private Sub DataGridView1_CellFormatting(sender As ObjectAs DataGridViewCellFormattingEventArgsHandles DataGridView1.CellFormatting
        If e
.ColumnIndex 0 Then
            If e
.RowIndex DataGridView1.Rows.Count 1 Then Exit Sub
            e
.Value CDate(e.Value)
 
           e.CellStyle.Format "yyyy-MM-dd"
 
       End If
 
   End Sub
   
'++++++++++++++++++++++++++++' 
الرد }}}
تم الشكر بواسطة:
#14
شكرا جاري التجربة
الرد }}}
تم الشكر بواسطة: asemshahen5
#15
كود :
Private Sub DataGridView2_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView2.CellFormatting
       If e.ColumnIndex = 3 Then
           If e.RowIndex = DataGridView2.Rows.Count - 1 Then Exit Sub
           e.Value = CDate(e.Value)
           e.CellStyle.Format = "yyyy-MM-dd"
       End If
   End Sub

اضفت هذا  ولم يحدث  تغيير
لا بد م الاضافة   في الموديول
اعتقد هذا

For intRow As Integer = 0 To DgvCountRow 'DGV.RowCount - 1
Application.DoEvents()
.WriteLine(" <Row ss:StyleID=""ksg"" ss:utoFitHeight =""0"">")
For intCol As Integer = 2 To DGV.Columns.Count - 1
Application.DoEvents()
.WriteLine(" <Cell ss:StyleID=""isi"">")
.WriteLine(" <Data ss:Type=""String"">{0}</Data>", DGV.Item(intCol, intRow).Value.ToString)
.WriteLine(" </Cell>")
'DGV.Columns(4).Visible = False
Next
.WriteLine(" </Row>")
Next
الرد }}}
تم الشكر بواسطة:
#16
هذا الكود يضاف في الفورم التي تحتوي على DataGridView .
1- غير هذا السطر من DataGridView2_CellFormatting الى اسم جدولك_CellFormatting و Handles DataGridView2.CellFormatting الى Handles اسم جدولك.CellFormatting
2- غير الرقم الموجود في If e.ColumnIndex = 3 Then الى رقم عامود التاريخ في الجدول و يجب بدأ العد من الصفر .
الرد }}}
تم الشكر بواسطة:
#17
PHP كود :
  Private Sub CellFormatting_following(ByVal sender As ObjectByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgsHandles CellFormatting.following
        If e
.ColumnIndex 3 Then
            If e
.RowIndex DataGridView2.Rows.Count 1 Then Exit Sub
            e
.Value CDate(e.Value)
 
           e.CellStyle.Format "yyyy-MM-dd"
 
       End If
 
   End Sub 

يعطي خطا تحت  
PHP كود :
Handles CellFormatting.following 
الرد }}}
تم الشكر بواسطة: asemshahen5
#18
Handles DataGridView2.CellFormatting
DataGridView2_CellFormatting
الرد }}}
تم الشكر بواسطة:
#19
d_visit
5/20/2022 12:00:00 AM
5/20/2022 12:00:00 AM
5/20/2022 12:00:00 AM
5/21/2022 12:00:00 AM
5/21/2022 12:00:00 AM
5/21/2022 12:00:00 AM
6/23/2022 12:00:00 AM
6/23/2022 12:00:00 AM


ما زال يعرض كما بالصورة
كل عام وانتم بخير
برجاء حل مشكلتي
الرد }}}
تم الشكر بواسطة:
#20
ما اسم الجدول .
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم