绝对路径信息必需错误 [英] Absolute Path Information Required Error
问题描述
朋友...我已经创建了一个示例Crystal Report应用程序vb.net2008.它在我的系统中正常工作部署该应用程序后,当我在另一台计算机上安装它时,它向我显示所需的绝对路径信息"错误.请帮助我解决这个问题.首先,我将告知我如何创建该应用程序
1.我选择vb.net应用程序
2.我在该应用程序中添加了一个Crystal报表
3.在"Crystal报表库"中,在选择专家"中选择使用报表向导和标准".
4.在创建标准报表向导"中,选择创建新连接",然后选择"OLE DB连接",然后选择"Microsoft Jet4.0 Ole Db Provider",然后在数据库名称"中选择数据库可用的路径,然后选择表i".想要显示在水晶报表中,然后单击完成".
5.之后,我拖放一个要在Crystal Report中显示的字段
6.然后在编码部分中我这样写
Hi friends... i hav create a Sample Crystal Report Application vb.net2008 .its working fine in my system After Deploying that Application when i installed in another computer it show me an error of "Absolute Path Information Required" . please help me to solve this problem.first i will tel how i create that application
1. i choose vb.net application
2. i added a Crystal report in that application
3. In the Crystal report Gallery I choose Using Report Wizard and Standard in Choose an Expert
4. In the Standard Report Wizard Creation i select Create a New connection in that i select OLE DB Connection then i select Microsoft Jet4.0 Ole Db Provider then in the Database name i select path where the database is available Then i select the Table i want to display in the crystal report then i clicked Finish .
5.After that i Drag a drop the Field i want to display in the Crystal Report
6.And in the coding part i written like this
Imports System.Data.OleDb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Dim crConnectionInfo As New ConnectionInfo
Dim crtableLogoninfo As New TableLogOnInfo
Dim CrTables As Tables
Dim CrTable As Table
Dim Crystaldataadapter As OleDbDataAdapter
Public connectionstring As OleDbConnection
Dim ds As New DataSet
Dim cryRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalReport1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
connectionstring = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "..\Calman.mdb;")
connectionstring.Open()
Crystaldataadapter = New OleDbDataAdapter("Select Instrumenttagno,Instrumentsl,description,make from CalInstrumentDetails where Instrumenttagno='MTCRTD'", connectionstring)
Crystaldataadapter.Fill(ds, "CaliInstrumentDetails")
MessageBox.Show(Application.StartupPath)
cryRpt.Load(Application.StartupPath & "..\CrystalReport1.rpt")
cryRpt.VerifyDatabase()
crConnectionInfo.DatabaseName = "Calman.mdb"
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
cryRpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
End Class
建立该项目后,它的工作状况很好....
水晶报表加载良好
之后,我在VS2008中部署了项目
在另一台计算机上安装该项目后,显示错误"Absolute Path Information Required"
请帮助我解决该问题.
After building that project its working fine ....
crystal report is loading fine
After that i deployed the project IN VS2008
after installing that project in another machine its showing the Error "Absolute Path Information Required"
Please help me how to solve this.
推荐答案
使用此功能.
Use this.
New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & Server.MapPath("..\Calman.mdb;"))
这篇关于绝对路径信息必需错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!