473,396 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

the Items Not found inthis collection error

Hi,
I've generated a report using crystal report 9.0 and VB.net.The database I used MS Access 2003.To Generate this report I've used query in MS Aceess and I've passed the two parameters as "year" and "month".

When I get the preview from thr crystal rport I canget the out put preview.But When I going to run the program through the Visual Studio.net, It says an error.

This is the code I wrote.

Dim objPaySummaryRpt As New PayrollSummery

Dim intMonth, intYear As Integer

intMonth = cmbMonth.SelectedValue
intYear = cmbYear.SelectedValue

Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables

Dim crConnectionInfo As New ConnectionInfo()
Dim crTableLogOnInfo As New TableLogOnInfo()

'------------------
Dim MyCon As OleDb.OleDbConnection
MyCon = New OleDb.OleDbConnection
MyCon.ConnectionString = System.Configuration.ConfigurationManager.Connecti onStrings("Pay_Roll_System.My.MySettings.payrollCo nnectionString").ConnectionString
MyCon.Open()
'------------------

crConnectionInfo.ServerName = MyCon.DataSource
crConnectionInfo.DatabaseName = MyCon.Database
crConnectionInfo.UserID = ""
crConnectionInfo.Password = ""

Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
crDatabase = objPaySummaryRpt.Database

crTables = crDatabase.Tables

For Each crTable As CrystalDecisions.CrystalReports.Engine.Table In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next

---------------------------------------------------
objPaySummaryRpt.SetParameterValue("AmountMonth", intMonth)
objPaySummaryRpt.SetParameterValue("AmountYear", intYear)

objPaySummaryRpt.SetParameterValue("QRMonth", intMonth)
objPaySummaryRpt.SetParameterValue("QRYear", intYear)

objPaySummaryRpt.SetParameterValue("User", frmLogin.strUserName)
---------------------------------------------------

MyCon.Close()

crvPaySummary.ReportSource = objPaySummaryRpt

Error Msg is - "the Items Not found inthis collection"& "Query engine error"
I need to pass the values to the parameters in my queriy through the vb.net code.
Can someone please help me???
Sep 20 '07 #1
0 724

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: RandyS | last post by:
I know how to do it in VB6, but that doesn't work in .NET. I am trying to select single or multiple items to load into a collection. -- ..NET Developer in Training
6
by: Valerian John | last post by:
I have a ListBox webcontrol on an aspx page. Items are added to the ListBox using client-side code. However, when the page is posted back the items are missing/not available. (It is like the...
7
by: Keith Patrick | last post by:
After completely giving up on finding some way in my ASP.Net app to take a query string URL and redirect to it as a POST instead, I went with a system like so: Upon "redirection," all the...
9
by: Don | last post by:
Is there any way to detect when an item has been added to the Items collection of a combobox or listbox? I am inheriting a Combobox and want to validate items before they are added to the...
2
by: Milsnips | last post by:
hi there, i have the following HTML code: -------------------------- <asp:DropDownList id="hddList" runat="server"> <asp:ListItem Value="1">Item 1</asp:ListItem> <asp:ListItem Value="2">Item...
10
by: guy | last post by:
why is it that some collection classes, eg BindingList, but others as well do not expose their Items property? It is there as a Protected property so why not make it public? I can work around...
14
by: Paul_Madden via DotNetMonster.com | last post by:
Basically I have a listbox to which I add simple STRING items- I have a progress bar which I increment whenever I populate another portion of the complete set of items I wish to add. What I observe...
0
by: marcobx | last post by:
I have a ComboBox and a List of objects to popolate items. I use the DataSource property and not the List collection: List<foolst = new List<foo>; //add elements into the list //......
4
by: randy.buchholz | last post by:
Just trying to get multiple dropdowns's to work inside another control (details view) I'm seeing this error, but not consistantly. I can even cut and paste a working set of controls into a new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.