如何将图像位置动态 Crystal 从字节数组报告

How put Image location dynamically Crystal report from byte array

我的问题很简单,但我找不到解决方案。 当我有路径时,我知道如何动态修改图片。 但是在我的项目中,我收集了人们的签名。我不想要文件(不够安全)然后我将它存储在数据库中(我使用 signature_pad 和服务器端我使用

 Dim dataUri = MesDonnees.Img
 Dim encodedImage = dataUri.Split(",")(1)
 Bdd.field = Convert.FromBase64String(encodedImage)
 ...

但是我没有解决如何把它放在我文档的页脚中... 我读了一些作品,但总是来自细节部分,我只有字符串类型、数字、布尔值……而不是字节或其他东西 感谢您的帮助

更新 我有个主意。尝试link此图片到ashx文件

 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
                    If Att.SignClient Is Nothing Then
                        Dim Vid() As Byte = New Byte(0) {}
                        context.Response.BinaryWrite(Vid)
                    Else
                        context.Response.BinaryWrite(Att.SignClient)
                    End If
                End If
                context.Response.Flush()
                context.Response.End()
            End If

    Catch ex As Exception
    End Try

如果我在 IE 中输入:http://localhost:63888/Signature.ashx?IdAttach=4&Typ=2 我有我的照片

但我尝试创建 SignClient 参数并为其分配位置 (x-2)

           cryRpt.SetParameterValue("SignClient", "~/Signature.ashx?IdAttach=4&Typ=2")
        cryRpt.SetParameterValue("SignClient", HttpContext.Current.Server.MapPath("/Signature.ashx") & "?IdAttach=4&Typ=2")
        cryRpt.SetParameterValue("SignClient", "http://localhost:63888/Signature.ashx?IdAttach=4&Typ=2")

这3种方法都不行。

我尝试直接将 http://localhost:63888/Signature.ashx?IdAttach=4&Typ=2 放在图像选项卡的位置 (x-2) 中:同上 我在 ashx 上设置了一个断点,但从未达到。然后我打开网络选项卡开发工具,但我的 ashx 从未调用。

我在header(标志)中有一张图片,我用路径文件(e:/../logo.png)更改了图片位置,这很好。

有人有想法吗?

最后,经过反复尝试,我找到的唯一解决办法是 1/做子报告(我的要求return只有1行) 2/ 在子报表中删除除详细信息部分之外的所有部分 3/ 创建一个 class with 属性 Contenu as byte() 4/ 将子报表中的数据字段添加到此新 class 并在详细信息部分删除字段

对于签名板,只需将背景颜色设置为 rgb(255,255,255),将笔颜色设置为 (1,1,1) 否则(CR 或 acrobat)显示黑色图像。