تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
التعامل مع TextObject فى الكريستال ريبورت بدون قاعدة بيانات
#1
السلام عليكم إخواني الكرام
كيف حالكم ؟

هذا الموضوع ملك للأستاذ mero5000 وقد طلب مني أن أنقل مشاركاته Smile

كود :
[COLOR=#007700][FONT=monospace][b]Try
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]' كود التفقيط كما ف درس التفقيط
            Dim m As New mero
            TextBox3.Text = (m.mero5000(TextBox2.Text))
            '  [/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]تفقيط المبلغ من
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]' TextBox2
            ' [/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]فى TextBox3
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]'=================================================
            ' [/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]للتعامل بها مع التقرير TextObject نعرف متغيرات من نوع
            Dim txt1 [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]As [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]TextObject
            Dim txt2 [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]As [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]TextObject
            Dim txt3 [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]As [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]TextObject
            Dim datee [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]As [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]TextObject
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]'=========================================
            Dim f As New Form2
            '  [/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]تعريف متغير للفروم 2
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]'=======================================================
            '[/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]نلاحظ هنا ان قمنا بتوصيل كل متغير الل
            txt1 [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]rpt[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportDefinition[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportObjects[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"Text1"[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b])
            [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]txt2 [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]rpt[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportDefinition[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportObjects[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"Text2"[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b])
            [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]txt3 [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]rpt[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportDefinition[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportObjects[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"Text3"[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b])
            [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]datee [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]rpt[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportDefinition[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportObjects[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"Text4"[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b])
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]' ثم كود توصيل المتغيرات بالادوات على الفروم
            txt1.Text = TextBox1.Text
            txt2.Text = TextBox2.Text
            txt3.Text = TextBox3.Text
            datee.Text = DateTimePicker1.Value
            '[/b][/FONT][/COLOR][COLOR=#007700][FONT=monospace][b]==============================================================
            [/b][/FONT][/COLOR][COLOR=#DD0000][FONT=monospace][b]'datee.Text = "التاريخ الان  " & Format(Me.DateTimePicker1.Value, "dd - MM - yyyy")
            '[/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]txt3[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Text [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"المبلغ - " [/b][/FONT][/color][color=#007700][FONT=monospace][b]& [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]TextBox3[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Text [/b][/FONT][/color][color=#007700][FONT=monospace][b]& [/b][/FONT][/color][COLOR=#DD0000][FONT=monospace][b]"فقط لا غير"
            '============================================================
            ' [/b][/FONT][/COLOR][COLOR=#0000BB][FONT=monospace][b]هذا كود عرض البيانات من الاداوت على الفروم داخل التقرير

            f[/b][/FONT][/COLOR][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]CrystalReportViewer1[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ReportSource [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]rpt
            f[/b][/FONT][/COLOR][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]CrystalReportViewer1[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Zoom[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#0000BB][FONT=monospace][b]90[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b]%)
            [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]f[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]CrystalReportViewer1[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]RefreshReport[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b]()
            [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]f[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Show[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b]()
        Catch [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]ex [/b][/FONT][/color][color=#007700][FONT=monospace][b]As [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]Exception
            MessageBox[/b][/FONT][/COLOR][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Show[/b][/FONT][/color][color=#007700][FONT=monospace][b]([/b][/FONT][/color][color=#0000BB][FONT=monospace][b]ex[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Message[/b][/FONT][/color][COLOR=#007700][FONT=monospace][b])
        [/b][/FONT][/COLOR][color=#0000BB][FONT=monospace][b]End [/b][/FONT][/color][color=#007700][FONT=monospace][b]Try [/b][/FONT][/color]


السلام عليكم ورحمة الله وبركاته


طلب منى احد الاخوة مثالا للتفقيط داخل الكريستال ريبورت

وللتذكير هنا موضوع للتفقيط تفقيط الارقام فى الدوت نت



سوف نتكلم فى هذا الدرس ان شاء الله للتعامل مع كائنات التقرير من نوع TextObject

والاتصال المباشر لها من TextBox1 الى TextObject بدون قاعدة بيانات

بسم الله نبدأ

نفتح الكريستال ريبورت ونختار مشروع من نوع as blank report
ثم ok
تظهر شاشة database expert نضغط cancel

بعد فتح التقرير التقرير

من قائمة insert نختار TextObject او من شريط الادوات

نضيف بعض من TextObject على التقرير وليكن 8 كائنات TextObject
نضع اربعة على اليمين واربعة على الشمال فى منطقة detalise فى التقرير
نعطى للكائنات الى على اليمين اسماء كتعريف للكائنات
مثل الاسم
التاريخ
المبلغ
اما الشمال نتركها فارغة
الان الكائنات الى على الشمال نقف على اى واحدة منها وكليك يمين ونختار format text
من التبويب common نجد ال object name للاداة على سبيل المثال Text1

هذا هو اسم الاداة الذى سنتعامل معه ان شاء الله بالكود

نحفظ التقرير الان باسم الافتراضى او اى اسم فى مجلد المشروع مع الفرومات وليس debug


الان نفتح الفيجول استوديو
نضيف 2 فروم
الاول به زر و 3 تكست بوكس و 4 ليبل و اداة التاريخ دايت تايم بكير

والفروم الثانى نضيف له من الاداوت CrystalReportViewer1

ثم نتبع هذا الدرس تفقيط الارقام فى الدوت نت فى اضافة ملف dll للمشروع لتفقيط الارقام

ومن قائمة project نختار add existing item
تظهر نافذه >> من الكمبوبوكس نختار CrystalReports.rpt
ونختار ملف التقرير الى قمنا بتصميمه سابقا

فى الفروم الاول نسمى الليبل كالتالى
الاسم - المبلغ - المبلغ بعد التفقيط - التاريخ

اولا نضيف فضاء الاسماء

كود :
[color=#0000BB][FONT=monospace][b]Imports CrystalDecisions[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]CrystalReports[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Engine [/b][/FONT][/color]

وفى الجنرال
نعرف الكريستال ريبورت الى قمنا بتصميمه

كود :
[color=#007700][FONT=monospace][b]Public Class [/b][/FONT][/color][COLOR=#0000BB][FONT=monospace][b]Form1
    Dim rpt [/b][/FONT][/COLOR][color=#007700][FONT=monospace][b]As New [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Report1[/b][/FONT][/color]

ثم نكتب فى حدث الكليك للزر الكود التالى




يمكننا الان تجربة البرنامج بنجاح ان شاء الله

تكلمنا فى اول الموضوع عن اضافة 4 TextObject كتعريف للكائنات

يمكن استبدال الامر هذا بالكود فى الدوت نت Smile

هكذا
كود :
[color=#DD0000][FONT=monospace][b]'datee.Text = "التاريخ الان  " & Format(Me.DateTimePicker1.Value, "dd - MM - yyyy")[/b][/FONT][/color]
كود :
[align=center][color=#DD0000][FONT=monospace][b]     '[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]txt3[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Text [/b][/FONT][/color][color=#007700][FONT=monospace][b]= [/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"المبلغ - " [/b][/FONT][/color][color=#007700][FONT=monospace][b]& [/b][/FONT][/color][color=#0000BB][FONT=monospace][b]TextBox3[/b][/FONT][/color][color=#007700][FONT=monospace][b].[/b][/FONT][/color][color=#0000BB][FONT=monospace][b]Text [/b][/FONT][/color][color=#007700][FONT=monospace][b]& [/b][/FONT][/color][color=#DD0000][FONT=monospace][b]"فقط لا غير"  [/b][/FONT][/color][/align]


وهكذا نكون قمنا بالاستغناء عن 4 كائنات TextObject كتعريف لكائنات عرض البيانات
وايضا نكون هكذا وفرنا مساحة فى التصميم للتقرير ايضا الوقت فى التنسق


انتهى الدرس
مرفق المشروع الذى تم العمل عليه والشرح

اتمنى ان يكون درس مفيدا للجميع

وصلى اللهم على سيدنا محمد وعلى اهله وصحبة

والسلام عليكم ورحمة الله وبركاته


اللَّهُمَّ أَنْتَ رَبِّي ، لا إِلَه إِلاَّ أَنْتَ خَلَقْتَني وأَنَا عَبْدُكَ ، وأَنَا على عهْدِكَ ووعْدِكَ ما اسْتَطَعْتُ ، أَعُوذُ بِكَ مِنْ شَرِّ ما صنَعْتُ ، أَبوءُ لَكَ بِنِعْمتِكَ علَيَ ، وأَبُوءُ بذَنْبي فَاغْفِرْ لي ، فَإِنَّهُ لا يغْفِرُ الذُّنُوبِ إِلاَّ أَنْتَ .
الرد }}}
تم الشكر بواسطة: Amir_Alzubidy , Amir_Alzubidy
#2
تم رفع المرفقات على موقع ميديافاير " إحتياطياً " وتم اخذ نسخة إحتياطية منها " بسبب وجود أخطاء برفع الملفات بالمرفقات

للتحميل : mero5000.rar
اللَّهُمَّ أَنْتَ رَبِّي ، لا إِلَه إِلاَّ أَنْتَ خَلَقْتَني وأَنَا عَبْدُكَ ، وأَنَا على عهْدِكَ ووعْدِكَ ما اسْتَطَعْتُ ، أَعُوذُ بِكَ مِنْ شَرِّ ما صنَعْتُ ، أَبوءُ لَكَ بِنِعْمتِكَ علَيَ ، وأَبُوءُ بذَنْبي فَاغْفِرْ لي ، فَإِنَّهُ لا يغْفِرُ الذُّنُوبِ إِلاَّ أَنْتَ .
الرد }}}
تم الشكر بواسطة: Amir_Alzubidy , Amir_Alzubidy
#3
شكرا لك اخ عمر
الرد }}}
تم الشكر بواسطة: Amir_Alzubidy , Amir_Alzubidy


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
Photo الارقام فى الكرستال ريبورت ahmedmansour 4 6,819 26-05-23, 04:06 PM
آخر رد: atefkhalf2004
  عرض الصورة الثنائية (كائن ) من اكسس داخل كرستال ريبورت younus 1 689 26-03-23, 04:23 PM
آخر رد: sanyor77
  الموقع الرسمي لتحميل تقارير كريستال ريبورت Crystal Reports محمد كريّم 6 43,012 26-10-22, 01:56 PM
آخر رد: خالد العصاوي
  تحميل كريستال ريبورت strongriseman 0 1,005 16-10-22, 09:35 AM
آخر رد: strongriseman
  [VB.NET] طباعة فاتورة باستخدام الكريستال ريبورت Abdoelftah 0 1,733 21-11-21, 11:25 PM
آخر رد: Abdoelftah
  اريد نسخة كريستال ريبورت 10 او أعلى لويندوز 10 Alhootti1 2 4,592 18-03-21, 12:22 PM
آخر رد: Alhootti1
Exclamation [سؤال] الموقع الرسمي لتحميل تقارير كريستال ريبورت Crystal Reports abarrak 0 1,781 13-03-21, 10:31 PM
آخر رد: abarrak
  [VB.NET] شرح طريقة الطباعة مباشرة بدون Report Viewer youcef3zino 2 5,329 18-12-20, 10:44 PM
آخر رد: a7med saba
  [مقال] كيفية التعامل مع XtraReport hoob computer 9 12,621 18-07-20, 10:39 AM
آخر رد: Ahmad shamkhi
  سؤال عن تقارير كريستال ريبورت Crystal Reports Yassin246 4 3,564 17-05-20, 03:24 PM
آخر رد: Yassin246

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


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