This is a migrated thread and some comments may be shown as answers.
Image and Parameters
3 Answers 128 Views
This is a migrated thread and some comments may be shown as answers.
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
Mário Alessand Gonçalves Oliveira asked on 13 Aug 2010, 07:21 PM
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,

3 Answers, 1 is accepted

Sort by
0
Jan
Top achievements
Rank 1
answered on 05 Nov 2014, 08:37 AM
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
0
Jan
Top achievements
Rank 1
answered on 05 Nov 2014, 08:38 AM
I meant string,Datetime,int etc.. not image
0
Hinata
Top achievements
Rank 1
answered on 07 Nov 2014, 04:26 PM
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.
Asked by
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
Answers by
Jan
Top achievements
Rank 1
Hinata
Top achievements
Rank 1
Share this question
or