未指定报告定义的来源 [英] the source of the report definition is not specified
本文介绍了未指定报告定义的来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
未指定报告定义的来源
这是我的代码
the source of the report definition is not specified
this is my code
With Me.ReportViewer1.LocalReport
' Report path
.ReportPath = Application.StartupPath & "C:\Users\noble\Desktop\WindowsApplication2\WindowsApplication2\Report1.rdlc"
' ReportViewer1.LocalReport.ReportPath = "C:\Users\noble\Desktop\WindowsApplication2\WindowsApplication2\Report1.rdlc"
.DataSources.Clear()
End With
' ----------------------------------------------------
' Datasource for the main report (where price > 200)
' ----------------------------------------------------
Dim SQL As String = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.Address, Voter.CardNo FROM Voter WHERE yadino=1"
Using da As New OleDbDataAdapter(SQL, My.Settings.trialConnectionString)
da.SelectCommand.Parameters.Add("@yadino", OleDbType.Integer).Value = 200
Using ds As New DataSet
da.Fill(ds, "voter")
' You must use the same name as defined in the report
' Data Source Definition
Dim rptDataSource As New ReportDataSource("dsReport_products", ds.Tables("voter"))
Me.ReportViewer1.LocalReport.DataSources.Add(rptDataSource)
Me.ReportViewer1.Reset()
End Using
End Using
ReportViewer1.RefreshReport()
为什么当我发生此错误时给出了正确的报告路径
任何人都知道
请帮助我。
why this error occur when i have given correct path of report
any body know
Please help me.
推荐答案
您好basurajkumbhar,
通过查看您的代码,我认为您的ReportPath没有获得路径。据我所知,路径在路径字符串之前用'@'符号指定。为什么你要使用这个?$
Application.StartupPath&C:\ Users \ noble \Desktop \ WindowsApplication2 \ WindowsApplication2 \ Report1rdlc?
我认为这是不正确的。
希望这个建议能够奏效。
-
谢谢
Hi basurajkumbhar ,
By looking your code I think that your ReportPath is not getting the path. As far as I know the path is specified with '@' sign prior the path string. And why you are using this
Application.StartupPath & "C:\Users\noble\Desktop\WindowsApplication2\WindowsApplication2\Report1.rdlc"?
I think this is not correct.
Hope this suggestion would work.
--
Thanks
这篇关于未指定报告定义的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文