Solved

SSRS 2005 IIF RowCount = 0 prevent report from printing

Posted on 2010-11-09
7
1,314 Views
Last Modified: 2012-06-22
SSRS 2005 IIF RowCount = 0 I want to prevent the report from printing a header and blank page (no data). The reports all use TSQL stored procedures.
0
Comment
Question by:rustypoot
7 Comments
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 34098703
is tehre any event on report like "after query open" or similar to this
so you can use

page.header.visible = IIF(Countrows("Scope") = 0, True, False)

(or use this in componetes hidden/visibility property)
 
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34098730
0
 

Author Comment

by:rustypoot
ID: 34098752
The Header & Footer appear not to have visibility properties.
The Goal is IIF RowCount =0  then Prevent Report from being printed ( basically RowCount = 0 there are no records in dataset).
I have the RowCount working -- I do not how to stop report. Can it be stopped in Custom Code (VB) ?
Is there a Report property I can use ?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:rustypoot
ID: 34098840
Since there is a stored procedure and I can capture RowCount too- could I stop SQL query and stop SSRS from processing report ?  Either way I need to STOP Report from printing when RowCount is Zero from dataset !!!
0
 
LVL 14

Expert Comment

by:Emes
ID: 34103875
can you put the report in a rectangle and then set the visibiltiy to true/false based on the row count.

0
 

Author Comment

by:rustypoot
ID: 34103981
Yes I can make table visibility & objects visibility in header(s) be hidden. But it will still generate a blank sheet.
I was looking for a way to STOP the Report based on RowCount =0 without printing.
0
 
LVL 4

Expert Comment

by:BostonMA
ID: 34239822
I have some ideas for how to acheive this, but first I want to be clear on what you are trying to acheive.  If there is no data returned in the Stored Procedure, what do you want to see in the report?  You say you want to Stop the report, does that mean prevent it from running?  That is if you have it sent through a subscription you would like the subscription not to be sent?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

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