cancel
Showing results for 
Search instead for 
Did you mean: 

How put image location from ashx file

Former Member
0 Kudos

Hello

I've create report. I've two type of picture. One in my header section. I change it mith parameter field and in right click on image in rpt file/ image tab/ x-2 on location.. I put my parameter.

cryRpt.SetParameterValue("Logo", HttpContext.Current.Server.MapPath("/images/logos/thelogo.png)
Here no problem. Picture are dynamically changed.
But now I try to do same thing but with a byte array in database. I try to change location to put directly : Convert.ToBase64String(Myrecord.MyColumn)
I try ashx file
Dim IdAtt As Long = CLng(HelperParams.GetParamURL("IdAttach"))
        Dim Typ As Integer = CInt(HelperParams.GetParamURL("Typ"))

            Dim LesDatas As New MyEntities
            Dim Att As Attachement = GetMonAttachement(IdAtt, LesDatas)
            If Att IsNot Nothing Then
                context.Response.ContentType = "image/png"
                If Typ = 1 Then
                    context.Response.BinaryWrite(Att.SignCollaborateur)
                Else
                        context.Response.BinaryWrite(Att.SignClient)
                End If
                context.Response.Flush()
                context.Response.End()
            End If

    Catch ex As Exception
    End Try

with parameter : cryRpt.SetParameterValue("SignClient", "http://localhost:63888/Signature.ashx?IdAttach=4&Typ=2") or directly in image property (right click...x-2 in location). But always default iamge.
The picture never show. Worst in ashx case, never called when I check the network.

If I put http://localhost:63888/Signature.ashx?IdAttach=4&Typ=2 in IE : I've my picture.

Someone have an idea

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Finally, just create subreport are the simplest solution (request returning one reccord...)

Answers (0)