locked
XtraReport call image url RRS feed

  • Question

  • User-891401704 posted

    Hi All, I have 1 Xtra report and have 1 Xtrapicturebox.  In xtraPicture box i call image url

    path to folder.  The folder path not save in db . 

    When i running the report.  The image not view.  I tried right click and saw the url path but only have file name.  Is it Xtra report can't call folder path without save path in database?

     

    Pls help me.  TQ

    Wednesday, January 13, 2010 4:26 AM

All replies

  • User259911192 posted

     When I use, i call xtrareport from aspx.cs file

    if  i just need insert image in picturebox that exist in xtrareport file. i use...

                //Code control about image url
                XRTableCell xrTC19 = xr6.Bands[BandKind.PageHeader].Controls["xrTable1"].Controls["xrTableRow1"].Controls["xrTableCell2"] as XRTableCell;
                XRPictureBox xrPB3 = xrTC19.Controls["xrPictureBox1"] as XRPictureBox;
                xrPB3.ImageUrl = "http://ComName/TestXtraR2/images/GPS_exp.png";

     or

    i don't create picturebox in xtrareport file but need to create from  aspx.cs file

         XRTableRow xrRow1 = xr.Bands[BandKind.Detail].Controls["xrTable1"].Controls["xrTableRow1"] as XRTableRow;   

         XRTableCell hd11 = xrRow1.Controls["xrHead11"] as XRTableCell;
         XRPictureBox img4 = new XRPictureBox();
         img4.ImageUrl = "http://ComName/TestXtraR2/images/header/Engine.png";
         img4.Borders = DevExpress.XtraPrinting.BorderSide.None;  
         Point p4 = new Point(3, 20);       // set positon of image in table cell
         img4.Location = p4;
         img4.Sizing = DevExpress.XtraPrinting.ImageSizeMode.AutoSize;
         hd11.Controls.Add(img4);

     

    or

    you have only image file name in database

                
                //get query from DB
               DataTable dtResult = QueryDataTable(sbSQL.ToString());

               
                XtraReport6 xr6 = new XtraReport6();

               //decare DataColumn and add in dtResult
                DataColumn dcAdd1 = new DataColumn("PIC_DIRECTION", typeof(System.String));
                dtResult.Columns.Add(dcAdd1);

                foreach (DataRow drEach in dtResult.Rows)
                {
                    drEach["PIC_DIRECTION"] = "http://ComName/TestXtraR2/images/sign/" + drEach["imagefilename"].ToString();           

                }
                xr6.DataSource = dtResult;

                xRTableCell xrTC3 = xr6.Bands[BandKind.Detail].Controls["xrTable1"].Controls["xrTableRow4"].Controls["xrTableCell3"] as XRTableCell;
                xrTC3.Controls["xrPictureBox2"].DataBindings.Add("ImageUrl", xr6.DataSource, "PIC_DIRECTION");

               ReportViewer1.Report = xr6;

     

    Tuesday, February 9, 2010 10:01 PM