Solved

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

Posted on 2010-09-18
5
265 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Steps to solve SSRS SQL 2008 R2 User Access Control (UAC) Permission Error With the introduction of SQL Server 2008 R2 and Vista (Windows 7 as well) came new enhanced security features. One of the features included was User Access Control (UAC) t…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now