Page 1 of 1

Load a Image in web report

Posted: Wed Feb 17, 2010 11:01 am
by Rajwill
Hi,
2 Doubts
First....
I trying to load a image saved in my vb web application to my web report and using the follow VB code:
'Create Image
Dim imagen As New Stimulsoft.Report.Components.StiImage()
imagen.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(8.4, 12.4, 2.6, 2.6)
imagen.Border = New Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None, System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, False, 4, New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black))
imagen.Brush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent)
'imagen.ImageToDraw = LoadBitmap("Imagenes/imgMasterCatalogos/Clientes42x42.png")
imagen.ImageURLValue = "~/Imagenes/imgMasterCatalogos/Clientes42x42.png"
imagen.ImageURL = New StiImageURLExpression(HttpContext.Current.Server.MapPath("~/Imagenes/imgMasterCatalogos/Clientes42x42.png"))
Page.Components.Add(imagen)


Currently when I run the application don't show me the image in my report, show me a broken imagen logo.
:ops:

Second...
When I put a watermark with VB code inside my report, the watermark appers in the report, like incomplete image.
I means if I write "Report" like watermark the report show me the letter R drawn in half, the letter E is missing a piece and the other shows it well. I have an alignment middle center
:ops:

Page.Watermark = New Stimulsoft.Report.Components.StiWatermark()
Page.Watermark.Text = "REPORT"
Page.Watermark.Font = New System.Drawing.Font("Arial", 60.0F)
Page.Watermark.TextBrush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(50, 0, 0, 0))
Page.Watermark.ImageAlignment = ContentAlignment.MiddleCenter

Could someone help me with these two questions?
How do to load the image in my web report?
how do to show complete the watermark?

Thanks in Advance


Load a Image in web report

Posted: Wed Feb 17, 2010 12:20 pm
by Rajwill
Hi Again,
I fix my doubt about watermarks:feelgood:

I can only doubt the handling of images with VB code, I still can not put a picture next to the title.

Someone could you guide me on this?

Load a Image in web report

Posted: Thu Feb 18, 2010 12:37 am
by Andrew
Hello,

Could you please either attach your report in this forum thread or send it to support@stimulsoft.com. Also please send us a screenshot to see how it looks like.

Thank you.

Load a Image in web report

Posted: Thu Feb 18, 2010 8:31 am
by Rajwill
Rajwill wrote: Hi,
I attached a screen shot of my problem with imagen loads from URL, the image is currently inside my images directory of my vb application, I try load an image with the follow code
Dim imagen As New Stimulsoft.Report.Components.StiImage()
imagen.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(8.4, 12.4, 2.6, 2.6)
imagen.Border = New Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None, System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, False, 4, New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black))
imagen.Brush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent)
imagen.ImageURLValue = "~/Imagenes/imgMasterCatalogos/Clientes42x42.png"
imagen.ImageURL = New StiImageURLExpression(HttpContext.Current.Server.MapPath("~/Imagenes/imgMasterCatalogos/Clientes42x42.png"))
imagen.Left = 0.0
imagen.Top = 3.0

Just show me a broken image

The application will be running in a web server.

Thanks in Advance
[/color]

Load a Image in web report

Posted: Fri Feb 19, 2010 10:16 am
by Andrew
Hello,

Perhaps it occurs bacause using the Server.MapPath method you get a link to the user's local drive (in case of Debug version on your computer, for example "D: \ \ MyProject \ \ Imagenes \ \ imgMasterCatalogos \ \ Clientes42x42.png" ) And the report generator can not upload an image using such URL due to security policy.

Please try to use relative URL, for example:
imagen.ImageURL = New StiImageURLExpression("Imagenes/imgMasterCatalogos/Clientes42x42.png")

Thank you.

Load a Image in web report

Posted: Fri Feb 19, 2010 11:57 am
by Rajwill
Great, worked!!!!:feelgood:
thanks