Solved

SSRS- repeatng rows

Posted on 2009-04-02
9
399 Views
Last Modified: 2012-05-06
I have just built my first report without using the SSRS report wizard.

I built my dataset using the following SQL:

SELECT     EmployeeKey, FirstName, LastName, MiddleName
FROM         DimEmployee

I placed a table on the Layout view and inserted a number of fields into the details section.

However the results which I get is repeating rows. Here is a screenshot  of my problem.
Is there a setting which I have missed.

I have followed the basic outline of the tutorial

http://msdn.microsoft.com/en-us/library/ms167559(SQL.90).aspx 

SSRS-Repeating-Rows.bmp
0
Comment
Question by:Mr_Shaw
  • 5
  • 3
9 Comments
 
LVL 9

Expert Comment

by:VikramMullick
ID: 24048386
It looks like  table DimEmployee has more columns than the 'EmployeeKey, FirstName, LastName, MiddleName'.
Hence your select query must be giving multiple rows.
If you wish to hide , duplicates , then for each textbox , go to properties
and there is a checkbox by the name hide duplicates. Tick it.
0
 

Author Comment

by:Mr_Shaw
ID: 24048473
the option to hide duplicated is greyed out.
0
 
LVL 16

Expert Comment

by:Auric1983
ID: 24049003
Mr.Shaw

one way to ensure you get unique rows for the report would be to modify your dataset to use the a query like the one below. I added the word "Distinct" that will give you a unique list so you shouldn't end up with duplicates.


select distinct EmployeeKey, FirstName, LastName, MiddleName
FROM         DimEmployee

Open in new window

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Mr_Shaw
ID: 24049476
still not working....
0
 
LVL 16

Accepted Solution

by:
Auric1983 earned 500 total points
ID: 24049490
Can you take a screenshot of your table in design mode?

Check the textboxes and see if you see something along the lines of this

=First(Fields!EmployeeKey.value)

0
 

Author Comment

by:Mr_Shaw
ID: 24049594
yes it was =First(Fields!FirstName.Value)

I changed it to =Fields!FirstName.Value and It worked...

It seems that =First(Fields!FirstName.Value) is the default when I dragged and dropped the field from the dataset...

Thanks for your help.
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31565714
thanks
0
 
LVL 16

Expert Comment

by:Auric1983
ID: 24049609
If you create a table on the report you need to be aware that it creates a header/detail/ and footer row automatically.

You also need to assign the table to your dataset in the properties window prior to dragging in your fields. (If you don't it will use the "First" prefix)

0
 

Author Comment

by:Mr_Shaw
ID: 24049941
thanks for the tip.

do you think you could help me with my other question

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_24288565.html
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question