تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ما هى المشكلة فى هذا الكود
#1
السلام عليكم ورحمة الله
هذا الكود يعمل كويس جدا وتظهر الداتا كما اريد وعند عمل معلينة قبل الطباعة يتم عرض الفاتورة كويس جدا جدا ولكن عند الضغط على طباعة لا يتم طباعة سوى اخر صفحة فى الفواتير بالرغم من ظهور الصفحات كاملة امامى فى المعاينة
برجاء مراجعة الكود
كود :
'اتجاة النص يمين
        Dim fr As New StringFormat(StringFormatFlags.DirectionRightToLeft)
        'نوع الخط وحجم الخط واللون
        Dim f88 As Font = New System.Drawing.Font("Arial", 9, FontStyle.Bold)
        Dim f12 As Font = New System.Drawing.Font("Arial", 12, FontStyle.Bold)
        Dim f As Font = New System.Drawing.Font("Arial", 13, FontStyle.Bold)
        Dim f18 As Font = New System.Drawing.Font("Arial", 18, FontStyle.Bold)
        Dim f182 As Font = New System.Drawing.Font("Blackadder ITC", 18, FontStyle.Bold)

        Dim f22 As Font = New System.Drawing.Font("Times New Roman", 22, FontStyle.Bold, FontStyle.Italic, FontStyle.Underline)
        Dim f28 As Font = New System.Drawing.Font("Arial", 24, FontStyle.Bold)
        Dim f282 As Font = New System.Drawing.Font("Algerian", 24, FontStyle.Bold)

        e.Graphics.DrawImage(Form1.PictureBox2.Image, 110, 250, 600, 600)
        'البيانات الاساسية للمدرسة أعلى الصفحة
        e.Graphics.DrawString("جمعية تحسين الصحة بشربين", f28, Brushes.Black, 790, 40, fr)
        e.Graphics.DrawString("(معمل التحاليل الطبية)", f28, Brushes.Black, 750, 80, fr)
        e.Graphics.DrawImage(Form1.PictureBox1.Image, 50, 30, 150, 120)
        e.Graphics.DrawLine(Pens.Black, 50, 150, 777, 150)
        e.Graphics.DrawLine(Pens.Black, 50, 153, 777, 153)
        e.Graphics.DrawString("الاســـــــم" + " /" + name_pat.Text, f, Brushes.Black, 790, 160, fr)
        If name_dr.Text = "----------" Then
            e.Graphics.DrawString("" + "", f, Brushes.Black, 790, 180, fr)
        Else
            e.Graphics.DrawString("اسم الطبيب " + "  " + name_dr.Text, f, Brushes.Black, 790, 180, fr)
        End If
        e.Graphics.DrawString("الكود" + " " + id_pp.Text, f, Brushes.Black, 200, 160, fr)
        e.Graphics.DrawString("التاريخ" + " " + dates.Text, f, Brushes.Black, 200, 180, fr)
        e.Graphics.DrawString(" رقم الزيارة" + " " + "/   " + no1s.Text, f, Brushes.Black, 450, 170, fr)
        Dim mypen As New Pen(Color.Black, 4)
        e.Graphics.DrawLine(mypen, 50, 220, 777, 220)
        e.Graphics.DrawString(ComboBox1.Text, f282, Brushes.Black, 250, 250)
        'رسم جدول

        e.Graphics.DrawRectangle(mypen, 50, 312, 727, 617)
        e.Graphics.DrawRectangle(mypen, 50, 312, 727, 50)

        e.Graphics.DrawString("Thanks", f22, Brushes.Black, 550, 960)
        e.Graphics.DrawString("Dr." + "  " + Form1.User_labdata1.tx_2.Text, f18, Brushes.Black, 500, 990)

        e.Graphics.DrawLine(Pens.Black, 50, 1030, 777, 1030)
        e.Graphics.DrawLine(Pens.Black, 50, 1033, 777, 1033)

        e.Graphics.DrawString(Form1.User_labdata1.tx_3.Text, f18, Brushes.Black, 660, 1050, fr)
        ' رسم الصفوف  وتحديد بداية الصفوف ونهايتها من قسم ارتفاع الجدول على عدد الصفوف

        ' رسم الاعمدة
        'Cplams
        e.Graphics.DrawLine(mypen, 530, 312, 530, 930)
        e.Graphics.DrawLine(mypen, 400, 312, 400, 930)
        'رؤوس الاعمدة

        e.Graphics.DrawString("Normal Range", f18, Brushes.Blue, 550, 330)
        e.Graphics.DrawString("Result", f18, Brushes.Blue, 430, 330)
        e.Graphics.DrawString("Test name", f18, Brushes.Blue, 200, 330)

      
            Dim y As Integer = 362
            For x As Integer = RowNo To DGV.Rows.Count
                Dim yElement As Integer = 375 + y - 375
                Dim x4 As Integer

                Dim xl As Long
                xl = Len(DGV.Rows(x - 1).Cells(2).Value.ToString())
                x4 = xl / 37
                x4 = x4 + 1
                x4 = x4 * 20

                Dim yE As Integer = x4 + yElement - y
                Dim ye2 As Integer = yE / 3
                If x4 >= "50" Then
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(0).Value.ToString(), f18, Brushes.Black, 65, yElement)
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(1).Value.ToString(), f18, Brushes.Black, 420, yElement)
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(2).Value.ToString(), f88, Brushes.Black, 535, yElement)

                    e.Graphics.DrawLine(Pens.Black, 50, yElement, 777, yElement)

                    y += x4
                Else
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(0).Value.ToString(), f18, Brushes.Black, 65, yElement + ye2)
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(1).Value.ToString(), f18, Brushes.Black, 420, yElement + ye2)
                    e.Graphics.DrawString(DGV.Rows(x - 1).Cells(2).Value.ToString(), f88, Brushes.Black, 535, yElement + 5)
                    e.Graphics.DrawLine(Pens.Black, 50, yElement, 777, yElement)


                    y += 40
                End If


                If yElement >= "700" Then
                    RowNo += 1
                    e.HasMorePages = True
                    Exit For
                Else
                    RowNo += 1

                End If

            
                x += 1
                y += 40
            Next
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [Acces2010] اريد تعديل الكود للاكسس بسام محمدغانم 0 833 13-10-21, 09:14 PM
آخر رد: بسام محمدغانم
  [Acces2010] ارجوكم ما هو الخطا فى الكود ؟ abomosaab alagan 1 1,110 16-09-20, 01:25 AM
آخر رد: معاند الحظ
  انشاء قاعدة بيانات SQL مع الجداول بواسط الكود aiman 1 3,943 26-12-19, 03:30 PM
آخر رد: osamaalymaghraby
  [SQL] هل ممكن المساعده في هذا الكود php mysql fadisat 0 1,428 07-08-19, 11:30 PM
آخر رد: fadisat
  أضافة زر إلى الفورم بواسطة الكود djelloul 1 1,871 02-05-19, 01:55 PM
آخر رد: PalmTree
  [سؤال] ما هو الخطأ فى هذا الكود احمد عبد الحكيم 1 1,894 07-07-17, 01:12 AM
آخر رد: silverlight
  طلب مساعدة لكتابة الكود بشكل صحيح moftah70 1 2,024 12-07-16, 07:52 PM
آخر رد: aliday03
  [سؤال] كيف افتح الاتصال باستخدام هذا الكود سعود 2 2,681 12-07-16, 06:23 PM
آخر رد: aliday03
  اريد استبدال الكود المرفق بكود ابسط على ان يعطي نفس النتيجة ledoledo 1 1,997 02-02-16, 07:07 PM
آخر رد: ledoledo
  [VB.NET] عرض الكود بار djelloul 2 2,100 15-01-16, 11:39 PM
آخر رد: djelloul

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


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