locked
Crystal Report XI - crystal report header picture change. RRS feed

  • Question

  • our company want to change its logo in crystal report header. we have 500 reports, do you know any script for that?

    thanks SJ

    Tuesday, February 5, 2013 8:33 PM

All replies

  • Hi SJ,

    After doing some research, I afraid there is no such a script to change the image in the report header for many reports at one time. However, if you design the report to load dynamic images in the report header, it will be much easier to do when the image needs to be changed. This is the code example:

    private void getImage()
        {
            FileStream fs;
            fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "img\\cube.png", FileMode.Open);
            BinaryReader BinRed = new BinaryReader(fs);
            try
            {
                CreateTable();
                DataRow dr = this.DsImages.Tables["images"].NewRow();
                dr["image"] = BinRed.ReadBytes((int)BinRed.BaseStream.Length);
                this.DsImages.Tables["images"].Rows.Add(dr);
    
                //FilStr.Close();
                BinRed.Close();
    
                DynamicImageExample DyImg = new DynamicImageExample();
                DyImg.SetDataSource(this.DsImages);
                this.crystalReportViewer1.ReportSource = DyImg;
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, "Error");
            }
    

    References:

    Hope this helps.

    Regards,


    Mike Yin
    TechNet Community Support

    Thursday, February 7, 2013 3:21 AM
  • thanks Mike,

    Image is OLE object.

    Thanks

    SJ

    Friday, February 8, 2013 4:17 PM