在Crystal Report标头上加载动态日志图像 [英] Load dynamic Log image on Crystal Report header
问题描述
亲爱的所有人,
我正在将VB.Net与Crystal Report一起使用.
我需要从标题部分更改动态徽标图像,该图像
来自数据库(类型为Var二进制).在我的应用程序中,我
以var binray的形式存储和提取图像.它可以正常工作,但晶莹剔透
报告如何可能任何人都知道,请提供一些有关
的想法
那.
谢谢.
SundaraRajan.C
Dear all,
I am using VB.Net with Crystal Report.
I need to change Dynamic Logo Image from my header part, that Image
come from Database (that type is Var binary.) In my application i
stored and retived the image as var binray. Its working but in crystal
report how could is possible Any one knows please give some ideas about
that.
Thanks.
SundaraRajan.C
推荐答案
这些应该可以帮助您:
Crystal Reports中的图像 [在Crystal Report .NET中显示动态图像 [ ^ ]
These should help you out:
Image in Crystal Reports[^]
Display Dynamic Image in Crystal Report .NET[^]
创建一个XSD文件来设计您的报告.
喜欢
Create a XSD File to design your report.
Like
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="FrontPage" targetNamespace="http://tempuri.org/FrontPage.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/FrontPage.xsd" xmlns:mstns="http://tempuri.org/FrontPage.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Document">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="FrontPage">
<xs:complexType>
<xs:sequence>
<xs:element name="CODE" type="xs:string" />
<xs:element name="ACCCODE" type="xs:string" minOccurs="0"/>
<xs:element name="SCMGRPCODE" type="xs:string" />
<xs:element name="GIVENNAME" type="xs:string" />
<xs:element name="CLIMG" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="DocumentKey1">
<xs:selector xpath=".//mstns:FrontPage" />
<xs:field xpath="mstns:ACCCODE" />
</xs:unique>
</xs:element>
</xs:schema>
使用XSD文件设计报告
注意CLIMG字段是您的Image字段
现在,将您的数据提取到数据集中.
使用
在yout数据集中添加新字段
Design your report using the XSD File
Note the CLIMG field is your Image field
Now fetch your data into a dataset.
Add a new field in yout dataset using
Dim c6 As New DataColumn("CLIMG", Type.GetType("System.Byte[]"))
ds.Tables(0).Columns.Add(c6)
现在,使用
将图像设置到您的数据集中
< pre lang ="vb">将bArr()复制为字节
bArr = ds.Tables(0).Rows(0)("MIMAGE")
ds.Tables(0).Rows(0)("CLIMG")= bArr
不要忘记将数据集名称更改为
中指定的名称
< xs:element name ="FrontPage">
如
Now Set the image into your dataset using
<pre lang="vb">Dim bArr() As Byte
bArr = ds.Tables(0).Rows(0)("MIMAGE")
ds.Tables(0).Rows(0)("CLIMG") = bArr
Dont forfget the change the dataset name to the name specified in
<xs:element name="FrontPage">
as
ds.Tables(0).TableName = "FrontPage"
设置数据源
Set the datasource
rptReport.SetDataSource(ds)
这篇关于在Crystal Report标头上加载动态日志图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!