Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Details section of table in SSRS should be fixed based on Dataset.

Posted on 2010-09-18
5
269 Views
Last Modified: 2012-05-10
hi

I have one query in SSRS.  i have a report which should be in pdf format.  in that i have a table which should have 5 details ( i mean lines).
Here I have question,  suppose if my dataset for the table is returing only 2 rows means, I need the report should be like first two rows should be with data and the remaining rows should be empty.

As of now this is not happening, because of this my report alignment is changing.

Ex:  
DataSet

Eno  ename
1       A
2       B

Output should be in Table ( SSRS)

EmployeeNo              EmployeeName
         1                                  A
         2                                  B
         -                                    -
         -                                    -
         -                                    -


Suppose if my dataset is returning :
0 roww    means, remaining 4 rows should be with "-"
1 row    means, remaining 4 rows should be with "-"
2 row    means, remaining 3 rows should be with "-"
3 row    means, remaining 2 rows should be with "-"
4 row    means, remaining 1 rows should be with "-"

If anyone knows the solution, please advise me.
Thanks in Advance.

Regards
Prakash
0
Comment
Question by:UJayaPrakashRao
  • 2
5 Comments
 
LVL 4

Expert Comment

by:timexist
ID: 33707740
HI UJayaPrakashRao
first, as I believe, the database always should prepare the data before it pass them to report.
so I think you should at the database stored procedure, prepare the data format and empty value format.

it means you always return 5 rows for stored procedure.

second, you put a IIF will fix the problem.
0
 
LVL 4

Expert Comment

by:timexist
ID: 33707743
I have a ssrs doing such things.
0
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 total points
ID: 33807011
The following query will always return 5 rows:

select TOP 5 * from
(
select 1 as IsDBRecord
union all
select 0
union all
select 0
union all
select 0
union all
select 0
) a LEFT OUTER JOIN(select EmployeeNo, EmployeeName from employee) b
ON 1=1
ORDER BY IsDBRecord DESC
the highlighted portion is your actual query. For the actual rows from the table, value of IdDBRecord will be 1 other wise 0.
Now in your report, check the value of IsDBRecord column. If it is 1 then display the actual value of EmployeeNo, EmployeeName etc. and if it is 0 then display "-".
It should work fine.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34662539
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server 2014 - Report Server - Stored Procs 8 61
SSRS UK Map with Postcodes 2 150
SSRS Pie Chart Data Points Inside AND Outside 4 94
Grid querry results 41 80
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

840 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