Image and Parameters

4 posts, 0 answers
  1. Mário Alessand Gonçalves Oliveira
    Mário Alessand Gonçalves Oliveira avatar
    7 posts
    Member since:
    Oct 2009

    Posted 13 Aug 2010 Link to this post

    Dear telerik support team,

    i have a telerik report wich i need to show my customer's logo, is there a way to i pass a byte[] to a picture box through report parameters?


    Report novoReport = (new GCReport.Sistema.CadastroBairro());
           List<BairroInfo> list = new List<BairroInfo>();
     
           if (this.IdCidade > 0)
           {
               list = (new BairroBLL()).ConsultarPorIdCidade(this.IdCidade).
                   OrderBy(obj => obj.NomeBairro).
                   OrderBy(obj => obj.Cidade.NomeCidade).OrderBy(obj => obj.Cidade.Estado.NomeEstado).
                   OrderBy(obj => obj.Cidade.Estado.Pais.NomePais).ToList(); ;
           }
           novoReport.ReportParameters["Rodape"].Value = Resources.Label.Rodape;
           novoReport.ReportParameters["GeradoPor"].Value = Resources.Label.GeradoPor;
           //CRED.Usuario.Pessoa.Foto = Byte[] from sql database
     //Image parameters = string type / multivalue = false
           novoReport.ReportParameters["Image"].Value = CRED.Usuario.Pessoa.Foto;
     
           novoReport.DataSource = (new ReportContainer<BairroInfo>(list[0]));
     
     
           rvBairro.Report = novoReport;
           rvBairro.RefreshReport();

    On my Telerik Report:
    this.pictureBox1.Value = "= Parameters.Image.Value";


    Thx,
  2. Jan
    Jan avatar
    2 posts
    Member since:
    Jan 2011

    Posted 05 Nov 2014 Link to this post

    Is there a way?? I try to pass a byte[] to Report Parameter, but this does not work, because there are only Basic types such as String,Image
  3. Jan
    Jan avatar
    2 posts
    Member since:
    Jan 2011

    Posted 05 Nov 2014 in reply to Jan Link to this post

    I meant string,Datetime,int etc.. not image
  4. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 07 Nov 2014 in reply to Jan Link to this post

    Hi Jan,

    Report parameters does not support image data type. You can edit the report definition before displaying in the viewer and set the pictureBox1.Value directly to your image.
    In case a report parameter is a must for you, you can pass the image as base64 string. Then convert the base64 string back to image using a user function.
Back to Top