Author |
Message |
Ralph55
Newbie
Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
|
Posted: 22 Feb 2013 at 2:31pm |
Hi, Dell,
I'm sorry, but I had to modify part of my program to make it more user friendly, and make / implement a help system. It is now in alpha testing, with no reports. I feel for it to be truly useful, it has to have reports.
Your code helped some, as I get the idea, but I'm still having trouble. Your code looks like it's either C# or C++, and these aren't my strong points. I'm working in VB.
I think you are creating a report, making an instance of it, so you can work with it programmatically. You set its data source to a dataset. Am I right?
When you do it like this, how do you design the layout of the report?
Thanks,
Ralph
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
Posted: 25 Feb 2013 at 3:31am |
That's exactly what I'm doing and yes, the code is C# - I don't do VB. I design the layout of the report in Visual Studio and connect it to the DataSet that's defined in the project. -Dell
|
|
IP Logged |
|
Ralph55
Newbie
Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
|
Posted: 01 Mar 2013 at 2:36pm |
Hi, Dell,
I got a simple report working! I'm having trouble with a report based on two tables. In the databaase expert, I select the tables I want, and I get a window showing how the tables are related, and it is right, so I go to the design part. Both tables are there with all of their fields. I pick the ones to display.
In my code, my SQL for my dataset is SELECT tblNames.Last, tblNames.First, tblNumbers.Phone FROM tblNames INNER JOIN tblNumbers ON tblNames.ID = tblNumbers.NameID where tblNames.ID = 2"
When the report displays, I get both records. Only one record in tblNames has an ID = 2, and only one record in tblNumbers has a NameID = 2
I changed the where clause in my SQL statement to tblNames.ID = 10, and still got both records on the report.
I even took out the rpt.SetDataSource(ds) line, and still get both records on the report.
What is wrong?
Thanks,
Ralph
Edited by Ralph55 - 02 Mar 2013 at 7:57pm
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
Posted: 04 Mar 2013 at 3:40am |
If you run the same query in, for example, SQL Server Managment Studio, what do you get for results? What type of connection are you using - ODBC or OleDB? -Dell
|
|
IP Logged |
|
Ralph55
Newbie
Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
|
Posted: 04 Mar 2013 at 7:14am |
Hi,
I don't have SQL Server. I'm using OleDB with the JET 4.0 engine to connect to an Access dB.
When I make a new query in VS and enter that SQL statement, it works as expected. It also works as expected inside Access.
Ralph
|
IP Logged |
|
Ralph55
Newbie
Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
|
Posted: 06 Mar 2013 at 7:08am |
Hi, Dell,
Can I send you the dB, the SQL statement, and the report to see if you can get it to display only the record returned in the dataset?
Thanks,
Ralph
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
Posted: 06 Mar 2013 at 8:55am |
I'll pm you my email address but I'm not sure when I'll have time to look at it - I'm getting married this weekend so in the next hour or so I'm going off-line until probably next Thursday. -Dell
|
|
IP Logged |
|
|