Load a Image in web report

Stimulsoft Reports.NET discussion
Post Reply
Rajwill
Posts: 16
Joined: Mon Feb 15, 2010 2:38 pm

Load a Image in web report

Post 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

Rajwill
Posts: 16
Joined: Mon Feb 15, 2010 2:38 pm

Load a Image in web report

Post 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?
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Load a Image in web report

Post 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.
Rajwill
Posts: 16
Joined: Mon Feb 15, 2010 2:38 pm

Load a Image in web report

Post 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]
Attachments
338.screenshot.jpg
338.screenshot.jpg (42.39 KiB) Viewed 2717 times
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Load a Image in web report

Post 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.
Rajwill
Posts: 16
Joined: Mon Feb 15, 2010 2:38 pm

Load a Image in web report

Post by Rajwill »

Great, worked!!!!:feelgood:
thanks
Post Reply