使用MDB在Crystal Report中加载图片 [英] Load Picture in Crystal Report with MDB

查看:55
本文介绍了使用MDB在Crystal Report中加载图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我已将图片的路径存储在MDB(MS Access)文件中。我能够将文本文件加载到报表中,但不能将图片加载到图片中,如何将文本和图片加载到Crystal Report中。请帮忙。谢谢。

Hi there,
I have stored the picture's path in MDB(MS Access) file. I am able to load the text files to the report, but not the picture, how do I get both the text and picture to be loaded to the Crystal Report. Please help. Thanks.

这是我到目前为止编写的代码: -

This the code I have written so far : -

Dim cn As OleDbConnection
Dim cmd As OleDbCommand

Dim cn As OleDbConnection
Dim cmd As OleDbCommand

cn =新OleDbConnection(" Provider = Microsoft.Jet.OLEDB.4.0; Data Source = DB.mdb;")
cn.Open()

cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb;")
cn.Open()

cmd =新的OleDbCommand(" SELECT * FROM tbl_KB_Main INNER JOIN tbl_KB_Issue ON tbl_KB_Main.KBM_GIDNo = tbl_KB_Issue.KBM_GIDNo WHERE tbl_KB_Main.KBM_GIDNo ='GID12120'ORDER BY tbl_KB_Issue.KBM_DNo",cn)

cmd = New OleDbCommand("SELECT * FROM tbl_KB_Main INNER JOIN tbl_KB_Issue ON tbl_KB_Main.KBM_GIDNo = tbl_KB_Issue.KBM_GIDNo WHERE tbl_KB_Main.KBM_GIDNo = 'GID12120' ORDER BY tbl_KB_Issue.KBM_DNo ", cn)

Dim DA As New OleDbDataAdapter(cmd)
Dim DS As New DataSet
Dim strReportName As String
DA.Fill(DS)
strReportName =" rpt_View_EPKMI"

Dim DA As New OleDbDataAdapter(cmd)
Dim DS As New DataSet
Dim strReportName As String
DA.Fill(DS)
strReportName = "rpt_View_EPKMI"

Dim strReportPath As String =" C:\" &安培; strReportName& " .rpt"

Dim strReportPath As String = "C:\" & strReportName & ".rpt"

Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument

Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument

rptDocument.Load(strReportPath)
rptDocument.SetDataSource (DS.Tables(0))
rptViewer.ShowRefreshButton = False


rptViewer.ShowGroupTreeButton = False
rptViewer.ShowZoomButton = True
rptViewer.ReportSource = rptDocument

rptDocument.Load(strReportPath)
rptDocument.SetDataSource(DS.Tables(0))
rptViewer.ShowRefreshButton = False
rptViewer.ShowCloseButton = False
rptViewer.ShowGroupTreeButton = False
rptViewer.ShowZoomButton = True
rptViewer.ReportSource = rptDocument

推荐答案

如果您使用Crystal Report 11

If u r using Crystal Report 11

在Crystal Report中添加图片对象

Add Picture Object in Crystal Report

右键单击图片对象

图片 - >图形位置 - >进入完整的物理路径&文件名例如

Picture --> Graphic Location --> enter full physical path & file name e.g.

'C:\Inetpub \wwwroot \webapplication1 \ imagesi \ image1.jpg'

'C:\Inetpub\wwwroot\webapplication1\images\image1.jpg'

已知问题

------------------------

------------------------

1。我们在设置.gif文件时遇到问题

1. we are getting problem in setting .gif files


这篇关于使用MDB在Crystal Report中加载图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆