-
Nov 13th, 2016, 01:35 AM
#1
Thread Starter
Addicted Member
External image show only red x
I have inserted an external image on my report. The report shows the image at design, but once I run my application only a red x is shown.
Any help would be much appreciated. Could it be a permisssions problem? How do I fix this?
Regards
-
Nov 13th, 2016, 03:09 PM
#2
Re: External image show only red x
Without any code it will be hard to tell.
Generally, you probably have something being done in the paint event and what you are referencing isn't valid yet at the time the first paint event happens.
You will usually need to add some test, eg. check to see if an object you are going to use in your paint event to draw with is not nothing before you draw.
If it is nothing then skip the drawing this time, and hopefully you'll get another paint event later, (or you can cause one), to do the drawing when the object is available.
Once the code in the paint event has failed, and the red X is displayed, I haven't found a way to fix that in already running code. You have to prevent the failure from happening.
-
Nov 14th, 2016, 01:23 AM
#3
Thread Starter
Addicted Member
Re: External image show only red x
Thank you passel for answering : Here is my code :
Imports Microsoft.Reporting.WinForms
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.ReportViewer1.LocalReport.ReportPath = "C:\Users\Administrator\Desktop\Trash\WindowsApplication50\WindowsApplication50\Report1.rdlc"
Dim parametervb As ReportParameter
parametervb = New ReportParameter("ReportParameter1", "File:" + "C:\Users\Administrator\Desktop\SKEDULERING\Grafieka\Plaaskaarte\8471.bmp", True)
ReportViewer1.LocalReport.EnableExternalImages = True
ReportViewer1.LocalReport.SetParameters(New ReportParameter() {parametervb})
Me.ReportViewer1.RefreshReport()
End Sub
End Class
-
Nov 14th, 2016, 04:15 AM
#4
Re: External image show only red x
I don't know anything about Microsoft.Reporting.
Perhaps the executable has to be tagged to run with administrator privileges to access where the picture is located.
Also Windows does odd things with file paths sometimes so perhaps the path isn't valid when running outside the development environment.
For a test, you should be able to create a directory right off the root, for example "c" off the C: directory "C:\c" and place the picture in there and change the path in the code to see if that makes any difference. That isn't the solution but may show that the path to the bitmap is the issue.
If it still doesn't work, then I don't really have an idea. I haven't worked with ReportViewer before.
-
Nov 15th, 2016, 05:31 PM
#5
Thread Starter
Addicted Member
Re: External image show only red x
Thank you passel. It seems no-one has a answer to my issue.
-
Dec 2nd, 2016, 11:10 AM
#6
Thread Starter
Addicted Member
Re: External image show only red x
Can anyone refer me to some-one that might help me with this issue?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|