Last post Apr 08, 2013 01:43 PM by ruipedromachado
Mar 25, 2013 01:18 PM|ruipedromachado|LINK
I have created a rdlc file one an empty project. This creation was done all with the design tools the rdlc report , the dataset and the datasource, no code behind. The rdlc file as lots of fields witch include : •normal text •datetime formatted string like
this : =Format(First(Fields!DataSaida.Value, "Obra"),"dd-MM-yyyy HH:mm:ss") •images
Now all this works perfect on this project.
Now I copied the RDLC file to my live project ( just the file ) and I am loading it from code behind. I have setup the dataset with all the fields and I load the report with this definitions :
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.LocalReport.ReportEmbeddedResource = @"ControloMaterial.Relatorios." + ReportName + ".rdlc";
reportViewer.LocalReport.DisplayName = ReportName;
reportViewer.LocalReport.EnableExternalImages = true;
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("Obra", ReportData.Tables["Obra"]));
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("Nota", ReportData.Tables["Nota"]));
when I load this the reports works fine except for the picture and the datetime fields.
the picture as a red cross in the top left corner ( html style) and the datetime fields display actual datetime format string from the formula ("dd-MM-yyyy HH:mm:ss").
Note : this is all on the same computer.
Note : when I debug I can see the dataset->datatable->imagefield with the byte array.
thks in advanced
Mar 26, 2013 08:21 AM|ruipedromachado|LINK
I managed to resolve the date field.
I changed to expression to normal and i´m formating the date value in the datatable´s codebehind.
Still havent figured out a way for the image.
Apr 08, 2013 01:43 PM|ruipedromachado|LINK
Hi no one?
maybe this will help, message that shows on the immediate window
Warning: The Value expression used in image ‘Image2’ returned a data type that is not valid. (rsInvalidExpressionDataType)
Warning: The value of the ImageData property for the image ‘Image2’ is “=First(Fields!TipoEquipamentoImagem.Value, "Obra")”, which is not a valid ImageData. (rsInvalidExternalImageProperty)