找回密码
 立即注册

QQ登录

只需一步,快速开始

handy_ou

注册会员

2

主题

3

帖子

66

积分

注册会员

积分
66
最新发帖

[已处理] 图片绑定问题

handy_ou
注册会员   /  发表于:2018-4-11 14:10  /   查看:2947  /  回复:3
<?xml version="1.0" encoding="UTF-8"?>
<ActiveReportsLayout Version="3.1" PrintWidth="11906" DocumentName="ARNet Document" ScriptLang="C#" MasterReport="0">
    <Sections>
        <Section Type="ReportHeader" Name="ReportHeader1" Height="0" BackColor="16777215" />
        <Section Type="PageHeader" Name="PageHeader1" Height="469.7938" BackColor="16777215">
            <Control Type="AR.Line" Name="horizontalLine1" X1="14.8481" Y1="164.8294" X2="11863.5164" Y2="164.8294" />
            <Control Type="AR.Line" Name="horizontalLine2" X1="14.8481" Y1="479.7938" X2="11863.5164" Y2="479.7938" />
            <Control Type="AR.Line" Name="PageHeaderVerticalBar0" X1="14.8481" Y1="164.8294" X2="14.8481" Y2="509.7938" />
            <Control Type="AR.Line" Name="PageHeaderVerticalBar1" X1="3974.3530" Y1="164.8294" X2="3974.3530" Y2="509.7938" />
            <Control Type="AR.Line" Name="PageHeaderVerticalBar2" X1="7933.8578" Y1="164.8294" X2="7933.8578" Y2="509.7938" />
            <Control Type="AR.Line" Name="PageHeaderVerticalBar3" X1="11863.5164" Y1="164.8294" X2="11863.5164" Y2="509.7938" />
        </Section>
        <Section Type="Detail" Name="Detail1" Height="324.9606" BackColor="16777215">
            <Control Type="AR.Line" Name="horizontalLine3" X1="14.8481" Y1="319.9606" X2="11863.5164" Y2="319.9606" />
            <Control Type="AR.Line" Name="DetailVerticalBar0" X1="14.8481" Y1="0" X2="14.8481" Y2="314.9606" />
            <Control Type="AR.Line" Name="DetailVerticalBar1" X1="3974.3530" Y1="0" X2="3974.3530" Y2="314.9606" />
            <Control Type="AR.Line" Name="DetailVerticalBar2" X1="7933.8578" Y1="0" X2="7933.8578" Y2="314.9606" />
            <Control Type="AR.Line" Name="DetailVerticalBar3" X1="11863.5164" Y1="0" X2="11863.5164" Y2="304.9606" />
            <Control Type="AR.Image" Name="Picture40" DataField="MdPicUrl" Left="3989.3511" Top="94.9981" Width="3824.5217" Height="284.9644"/>
            <Control Type="AR.Field" Name="Textbox2" DataField="MdCode" Left="29.8463" Top="94.9981" Width="3824.5217" Height="284.9644" Text="商品编码" Style="font-family:宋体; font-size:10.5pt; vertical-align:top; text-align:left;vertical-align: middle; ddo-char-set: 0;" />
        </Section>
        <Section Type="PageFooter" Name="PageFooter1" Height="0" BackColor="16777215" />
        <Section Type="ReportFooter" Name="ReportFooter1" Height="885.0019" BackColor="16777215">
            <Control Type="AR.Line" Name="horizontalLine4" X1="14.8481" Y1="399.9587" X2="11863.5164" Y2="399.9587" />
            <Control Type="AR.Line" Name="PageFooterVerticalBar0" X1="14.8481" Y1="-40" X2="14.8481" Y2="404.9587" />
            <Control Type="AR.Line" Name="PageFooterVerticalBar1" X1="3974.3530" Y1="-40" X2="3974.3530" Y2="404.9587" />
            <Control Type="AR.Line" Name="PageFooterVerticalBar2" X1="7933.8578" Y1="-40" X2="7933.8578" Y2="404.9587" />
            <Control Type="AR.Line" Name="PageFooterVerticalBar3" X1="11863.5164" Y1="-40" X2="11863.5164" Y2="399.9587" />
        </Section>
    </Sections>
    <ReportComponentTray />
    <Script>
        <![CDATA[public void Detail1_BeforePrint(){ControlCollection ctl = rpt.Sections["Detail1"].Controls;float y = 0;foreach(object obj in ctl){if (obj is Line){Line l = (Line)obj;if (l.Y1 == l.Y2)y = l.Y1;}}foreach(object obj in ctl){if(obj is Line){Line l = (Line)obj;if (l.X1 == l.X2)l.Y2 = y;}}}]]>
    </Script>
    <PageSettings LeftMargin="567" RightMargin="567" TopMargin="567" BottomMargin="567" PaperWidth="13040" PaperHeight="11169" PaperSize="0" PaperName="Custom paper" />
    <Parameters />
</ActiveReportsLayout>



数据源绑定:

foreach (DataRow row in table.Rows)
                {
                    //var buff = Convert.FromBase64String(row["Img"].ToString());
                    row["MdPicUrl"] = "http://img10.360buyimg.com/n0/jfs/t19669/78/1470434306/357290/f5ff6839/5acc84faN1c77a4a5.jpg";
                }
                //dv = table.DefaultView;

                report.DataSource = dv;
                report.Document.Printer.PrinterName = "";
                report.Run(true);


这样图片无法显示

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

3 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2018-4-11 17:58:46
沙发
您好!
您先确定您的图像路径是正确的,比如先放一个本地路径的图片,看是否可以正常显示。
回复 使用道具 举报
handy_ou
注册会员   /  发表于:2018-4-11 18:01:25
板凳
KearneyKang 发表于 2018-4-11 17:58
您好!
您先确定您的图像路径是正确的,比如先放一个本地路径的图片,看是否可以正常显示。

http://img10.360buyimg.com/n0/jf ... cc84faN1c77a4a5.jpg 这个路径是可以正常访问的
回复 使用道具 举报
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2018-4-12 09:43:29
地板
您好!
你用的是区域报表,然后图片是绑定的一个数据源里的地址,还是直接绑定的一个链接地址。

要不您把报表模板发过来看看,因为报表图片绑定路径就两种

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部