Hi,
I am evaluating the use of NetAdvantage Reporting in a WPF application run locally.
Currently the file path to the image is stored in a field within an SQL Compact database. How do i bind this field to an Image object?
I have tried but the image is only displaying an 'X'. does this mean it cannot find the image?
I have tested the datasource as well as confirmed the image path is correct.
Any help is greatly appreciated.
pfechner
Hi pfechner,
You can view the Using the Image Control article, long story short, you need to create a SQL Data Source that references the SQL Compact database & desired entity, and when you create the image control, add a binding to the Image field if your data contains the serialized image, or to the ImageUrl field if your data contains a URL with the location of the image.
The X means that there was an error while loading the image, it could be that it did not find the image, or that the image format is not supported (we support only JPG and PNG images).
Let us know if you have any questions.
Regards,Héctor
HI Hector,
thanks for the reply.
I can confirm i have a successful connection to the sql compact database and see data when i press the test query button.
I can also confirm the path is correct by copying the result into windows explorer.
The data being returned looks like:
I am using vs2010 and wpf (vb.net).
I have only just started to look at the infragistics reporting so i will most likely be doing something silly.
I just tried dragging the datasource field onto the report (Expr1) and pressed the preview button and i get the error
"Infragistics.Reports.Engine.EngineException: Error in DataContext =DataSources.sqlDataSource3.An error occurred while binding an expression."
What am i doing wrong?
Do i need to use the Report Viewer object?
I will do that, however, do you get a window like the following when you create the connection?
EDIT: Try rebuilding, closing and reopening the report, just in case.
Attached a simple example that uses the Northwind database using SQL Compact Edition (4.0 in this case, but it should be almost identical in 3.5).
Note that the image data of the Employees table in the Northwind database has an OLE header, which would cause the employee photo not to be displayed. If you want to display such images, you would need to use an Object Data Source and manually remove such header. One does not need to do so for normal images.
Hi Hector,
sorry, i am receiving the same issue with your sample.
This is what i did.
I also did a test where i renamed the db and then pressed the "Preview" button. I get the exact same error. Could it be that the designer cannot see the database file when previewing?
If you copy the database file to the "My Documents" folder and try to use it, do you experience the same issue?
I just opened my original WPF project and it will no longer compile since running the service release.
I am receiving alot of errors similar to below:
Warning 15 Could not resolve this reference. Could not locate the assembly "InfragisticsWPF4.Controls.Editors.XamMaskedInput.v12.2, Version=12.2.20122.2022, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. WpfApplication1
How do i resolve this?
run the upgrade utility and all is well again :).