الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف اطبع صورة في تقرير كريستال ربورت ؟ ارجو المساعده

بدأه ضاري في 11 أغسطس 2009 · 2 رد · 472 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بســم الله الـرحمــن الرحيــم

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

كيف حالك إن شاء الله دائمــاً بخير ؟

اخواني لدي قاعدة بيانات لاسماء اشخاص

لكل شخص صورة مع بياناته ويوجد حقل يحمل رابط الصورة في المجلد

وعملت تقرير كريستال ربيورت لطباعة بيانات كل شخص على شكل بطاقة عمل

السؤال:

كيف اقدر اضهر الصورة لاي شخص مع بياناته في التقرير ؟ هل استطيع ذلك من الحقل المحفوظ فيه رابط الصورة ؟

اتمنى المساعده لاني بحثت وحاولت ولكن دون جدوى

#2
    try { 
        // here i have define a simple datatable inwhich image will recide 

        DataTable dt = new DataTable(); 
        // object of data row 

        DataRow drow; 
        // add the column in table to store the image of Byte array type 

        dt.Columns.Add("Image", System.Type.GetType("System.Byte[]")); 
        drow = dt.NewRow; 
        // define the filestream object to read the image 

        FileStream fs; 
        // define te binary reader to read the bytes of image 

        BinaryReader br; 
        // check the existance of image 

        if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg")) { 
            // open image in file stream 

            fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg", FileMode.Open); 
        } 
        else { 
            // if phot does not exist show the nophoto.jpg file 

            fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "NoPhoto.jpg", FileMode.Open); 
        } 
        // initialise the binary reader from file streamobject 

        br = new BinaryReader(fs); 
        // define the byte array of filelength 

        byte[] imgbyte = new byte[fs.Length + 1]; 
        // read the bytes from the binary reader 

        imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length))); 
        drow(0) = imgbyte; 
        // add the image in bytearray 

        dt.Rows.Add(drow); 
        // add row into the datatable 

        br.Close(); 
        // close the binary reader 

        fs.Close(); 
        // close the file stream 

        CrystalReport1 rptobj = new CrystalReport1(); 
        // object of crystal report 

        rptobj.SetDataSource(dt); 
        // set the datasource of crystalreport object 

        CrystalReportViewer1.ReportSource = rptobj; 
        //set the report source 

    } 
    catch (Exception ex) { 
        // error handling 

        Interaction.MsgBox("Missing 10157.jpg or nophoto.jpg in application folder"); 
    } 
// run the application to view image in report

http://www.codegain.com/index.php?option=c...icle&id=151

و اليك ملف مرفق ينفعك ىو هو مثال

sourcecode.zip

arab-code-logo.png

---------------------------

ليست المشكلة أن تخطــىء ، حتى لوكان خطئك جسيما

وليست الميزة أن تعترف بالخطـــأ وتتقبل النصح .. إنمـا

العمل الجبــار الذي ينتظرك حقا هو أن لا تعـــــــــــــود

للخطـــــــأ أبــدا ……

#3

يعطيك العافيه اخوي ماقصرت

جزاك الله خير

لكن الكود معقد شوي ماقدرت افهمه

ياليت مثال يكون بال ASP.net

واذا امكن يكون على قاعدة بيانات اكسس

يتم حفظ رابط الصور داخل حقل ثم في التقرير يتم جلب الصورة من الرابط

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…