Monday, February 20, 2012

Report pulls only first record

Hello,

First I'd like to thank Michel Smit for providing the instructions on how to create/recreate a report using VWD then converting it to C# Express. It was a tremendous help.

My report is generating, however, it is only pulling the first record in the database (there are four records in all). My report uses a stored procedure shown below:

ALTER PROCEDURE dbo.StoredProcedure1

AS

SET NOCOUNT ON;

SELECT inventory.*, Feeding.*

FROM Feeding CROSS JOIN inventory

Is there something wrong with this stored procedure? Or is there some other step I need to include. I was experiencing the "A data source instance has not been supplied for the data source" error before and I corrected that issue when I discover the report was looking at the wrong data source. However, on the information I found to the correct the problem it said that when the correct source is located, the relevant components should be created on the design surface which they are not, could this be contributing to my issue?

walkswan

if you want to pull all records regardless of whether or not they have related records in another table, then you must research the use of LEFT JOIN and RIGHT JOIN.

Hope that helps. Without seeing your data i'm just guessing that only 1 of your records has a related record in the joined table. (i believe cross join, like inner join, only shows records that have related records in BOTH joined tables.)

|||

Thank you, unfortunately I can't get it to work at the moment. I ran three more types of queries based on the suggestion and they all returned the information I wanted but when I run the report I still only get the first record. I did double check and I have three records in the second table with id's that match records in the first table. Any other ideas?

walkswan

No comments:

Post a Comment