Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Stop parameter report from automatically launching

Author  Topic 

duanecwilson
Constraint Violating Yak Guru

273 Posts

Posted - 2010-03-23 : 17:27:31
I have a report that has a lot of data behind it. It is based on a parameterized stored procedure. The parameters interpret NULL as a 'SELECT ALL'. There are several of these. When I execute the SP, I can include a parameter and it will filter on that. If nothing is entered, it selects ALL. The SP works fine. The SSRS report works fine except for one major thing: It fires without giving a chance to enter the parameters. If I interrupt it, it goes back to the screen and prompts me to enter the parameters. This is what I want the first time without launching automatically (in effect grabbing ALL the data). I ended up putting a dummy parameter on the page and giving the user a prompt for 2 options (but it does nothing but force the report to pause to accept parameters). I forgot to mention that all the main parameters are set to accept NULL or blank values.

Duane

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-23 : 18:11:04
I would say that reports WITHOUT parameters are rendering automatically. Reports WITH parameters don't.
Maybe you have given default values to all parameters and that's why it is running without waiting for input?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

duanecwilson
Constraint Violating Yak Guru

273 Posts

Posted - 2010-03-24 : 13:18:50
Thank you for your response, but I definitely have parameters in this report and it is running automatically and I don't have defaults. I did have checked on each one to allow NULLS and allow Blanks and it ran automatically. What I did was change one field to allow blanks but not NULLS and then it prompted me. When I allowed NULLs, the NULL box was checked by default, and maybe that is why it ran automatically. But I didn't couldn't control that checkbox and it did not have a default of NULL checked. I don't know why it checks the box by default. It seems like a contradiction. The report does seem to work properly now that I have removed the allow NULL on that first field.

Duane
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-24 : 13:27:19
quote:
Originally posted by duanecwilson

Thank you for your response, but I definitely have parameters in this report and it is running automatically and I don't have defaults. I did have checked on each one to allow NULLS and allow Blanks and it ran automatically. What I did was change one field to allow blanks but not NULLS and then it prompted me. When I allowed NULLs, the NULL box was checked by default, and maybe that is why it ran automatically. But I didn't couldn't control that checkbox and it did not have a default of NULL checked. I don't know why it checks the box by default. It seems like a contradiction. The report does seem to work properly now that I have removed the allow NULL on that first field.

Duane


what was option you selected for default value in the parameters tab for the problem causing params?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

duanecwilson
Constraint Violating Yak Guru

273 Posts

Posted - 2010-03-24 : 13:49:13
No default value for any of them. The top radio button (No default) was selected for all of them (I am using 2008 - it doesn't have the parameter tabs anymore, but has a parameter node in the Report Data pane.) I'll include my SP here so you can look at that as well. Maybe I did something wrong in it:
USE [SoftwareReporting]
GO

/****** Object: StoredProcedure [dbo].[sp_ReportBasic] Script Date: 03/24/2010 10:08:56 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[sp_ReportBasic]
@AppName VARCHAR(255) = NULL,
@WkstnName VARCHAR(128) = NULL,
@EmployeeID VARCHAR(255) = NULL,
@PAYROLL_CO_num VARCHAR(4) = NULL,
@PAYROLL_RC_num VARCHAR(7) = NULL,
@MANAGER_EMPLOYEE_ID VARCHAR(255) = NULL
AS
BEGIN
SELECT v_CommonApp.AppName
, v_SMSAppData.[Version]
, v_SMSAppData.WkstnName
, SMS_Hardware.EmployeeID
, ePeople_feed.NAME
, ePeople_feed.PAYROLL_CO_num
, ePeople_feed.PAYROLL_RC_num
, ePeople_feed.EMAIL_ADDRESS
, ePeople_feed.PHONE_NUMBER
, ePeople_feed.MANAGER_EMPLOYEE_ID
, ePeople_feed.MANAGER_NAME
, ePeople_feed.MANAGER_PHONE
FROM v_SMSAppData
LEFT JOIN v_CommonApp ON v_SMSAppData.appID = v_CommonApp.AppID
LEFT JOIN SMS_Hardware ON v_SMSAppData.WkstnName = SMS_Hardware.wksname
LEFT JOIN ePeople_feed ON SMS_Hardware.EmployeeID = ePeople_feed.EMPLOYEE_ID
WHERE (@AppName IS NULL OR AppName LIKE '%' + @AppName + '%')
AND (@WkstnName IS NULL OR WkstnName LIKE '%' + @WkstnName + '%')
AND (@EmployeeID IS NULL OR EmployeeID = @EmployeeID)
AND (@PAYROLL_CO_num IS NULL OR PAYROLL_CO_num = @PAYROLL_CO_num)
AND (@PAYROLL_RC_num IS NULL OR PAYROLL_RC_num = @PAYROLL_RC_num)
AND (@MANAGER_EMPLOYEE_ID IS NULL OR EmployeeID = @MANAGER_EMPLOYEE_ID)
ORDER BY v_CommonApp.AppName
END

GO

And here is the section of XML code for the RDL. The AppName remember I had as nullable as well (before)
  <ReportParameters>
<ReportParameter Name="AppName">
<DataType>String</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>App Name</Prompt>
</ReportParameter>
<ReportParameter Name="WkstnName">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>Wkstn Name</Prompt>
</ReportParameter>
<ReportParameter Name="EmployeeID">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>Employee ID</Prompt>
</ReportParameter>
<ReportParameter Name="PAYROLL_CO_num">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>PAYROLL CO num</Prompt>
</ReportParameter>
<ReportParameter Name="PAYROLL_RC_num">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>PAYROLL RC num</Prompt>
</ReportParameter>
<ReportParameter Name="MANAGER_EMPLOYEE_ID">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>MANAGER EMPLOYEE ID</Prompt>
</ReportParameter>
</ReportParameters>
Anyway, thanks for the help.

Duane
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-24 : 14:26:26
this sp doesnt require any parameters to be passed. it will work with default NULL values and give you result even if you're not passing anything

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

duanecwilson
Constraint Violating Yak Guru

273 Posts

Posted - 2010-03-24 : 14:58:22
I guess I understand with the sp default NULL values, the report just lauches (if I allow NULL values) automatically since the defaults are NULL. I just wish there were a way to force it to pause to let you decide if you want to pass the NULLs to it (or nothing) or change them before it runs. But the workaround, as stated earlier is to change one of the parameters (AppName) to allow blanks only and not NULLs. I am not sure what the difference is between the Blank and the NULL in this case because when I make the AppName to allow Blanks and not NULLS, the SP still treats it as a passed NULL becasue when blank it returns all the AppNames. I understand in theory the difference, but in practice it gets very murky. Thank you again.

Duane
Go to Top of Page

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2010-12-10 : 13:47:27
I know this is old but I just want to say that I'm having the same problem as Duane, but my parameter is an integer that allows nulls. I want the report to default to NULL being checked, but the textbox being blank and the report not running until the user hits View Report, since most of the time they will be entering a customer id and not want to see all orders. I really hope Microsoft fixes this before they finally come out with a new version of SSRS.
Go to Top of Page
   

- Advertisement -