Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Thursday, March 29, 2012

Creating an All option for parameter value in GUID format

I am working with SRS 2005 SP1 which no longer has the "ALL" option available on parameters. I am trying to create an "ALL" entry in a picklist so it can be used in a where clause for a dataset. I have a dataset with a union statement that creates a list of CRM usersids and names and an entry with a dummy guid with the name "All". Parameter is defined as a string type, with a dataset providing a list of users (label field) and their corresponding GUID value (value field), along with the an "All" entry.

select systemuserid, fullname
from FilteredSystemUser
Union
Select '00000000-0000-0000-0000-000000000000' as systemuserid, ' All' as fullname
order by fullname

The issue I am running into is implementing logic in another dataset referencing my parameter.

All is fine in the where clause if it is structured "where ownerid in (@.Users)" but if I try to add logic to check for the "All" option "where (ownerid in (@.Users) or @.Users = '00000000-0000-0000-0000-000000000000') it errors out.

How do you impement "All" when you're dealing with a GUID type field? Thanks.

Have you looked at SSRS SP2? It puts the Select All option back. You can get it HERE

R

|||Thanks. We will be installing SP2.

Thursday, March 22, 2012

creating a table

I need a module to help me create a SQLServer database table. Is there a module that allows users to specify parameters in the creation of a SQLserver table?well, firing a CREATE TABLE sql statement allows a fine level of control over table creation, as does using the SQL Server client tools. what exactly is your requirement here?sql

Wednesday, March 21, 2012

Creating a report using a stored procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks, Joe

You would be better posting this on the reporting services forum, as this is mainly for T-SQL issues

Creating a report using a Stored Procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks,

Joe

How about something like

exec uspTest @.parm1, @.parm2

If I remember right it will provide a couple of boxes for you to type the parm values when you view the report in Report Manager

|||the parameters (Report Parameters) you have in RS should have the same name as the parameters you declare in stored procedure.sql

Sunday, February 19, 2012

CreateSubscription Extension Parameters

The following Extension Parameters are not being accepted --
CreateSubscription works and a record is created, but three values are not
getting through to the database:
extensionParams(3) = New
rsSubscriptions.SVR03_ReportService.ParameterValue
extensionParams(3).Name = "RENDERFORMAT"
extensionParams(3).Value = pReportType
extensionParams(4) = New
rsSubscriptions.SVR03_ReportService.ParameterValue
extensionParams(4).Name = "WRITEMODE"
extensionParams(4).Value = "AutoIncrement"
extensionParams(5) = New
rsSubscriptions.SVR03_ReportService.ParameterValue
extensionParams(5).Name = "UserName"
extensionParams(5).Value = "myuserid"
extensionParams(6) = New
rsSubscriptions.SVR03_ReportService.ParameterValue
extensionParams(6).Name = "PassWord"
extensionParams(6).Value = "mypassword"
The "WRITEMODE" is the only of the above Extension Parameters that is
correct when I go into the detail screen. The format says "XML file with
report data" (the default) and the Userid and Password are blank.
Everything else is working great.
Any suggestions? I tried all-caps for the Param.Name (as they display coming
out of the ListSubscriptions method), but that made no difference.
Thanks!
AJThere isn't much documentation that I found that tells you exactly how
the name should be spelled, so I used this code:
rs.GetDataDrivenSubscriptionProperties(subscriptionID, out exSet,
out dataPlan, out desc, out aState, out status,
out eventType, out matchData, out parameterVal);
ParameterValue param =(ParameterValue)exSet.ParameterValues.GetValue(3);
lblName.Text = param.Name.ToString();
To get the names (you just change the number in GetValue). Here is
what I found from this:
FILENAME
FILEEXTN
PATH
RENDER_FORMAT
USERNAME
WRITEMODE
In addition, trial and error has shown me that:
PASSWORD
is what RS is expecting for the password.
Try using these EXACTLY as shown here and see if it helps.
Sheridan Saint-Michel|||Thanks, Sheridan,
I went back and checked my test matrix and realized that I hadn't tested
case-sensitivity on that parameter name. It appears that CreateSubscription
will load Extension Parameters into the database even if they are incorrect,
and this was throwing me off.
I've now loaded my (hundreds) of new report requests and the schedule is
running!
AJ.
"Sheridan" wrote:
> There isn't much documentation that I found that tells you exactly how
> the name should be spelled, so I used this code:
> rs.GetDataDrivenSubscriptionProperties(subscriptionID, out exSet,
> out dataPlan, out desc, out aState, out status,
> out eventType, out matchData, out parameterVal);
> ParameterValue param => (ParameterValue)exSet.ParameterValues.GetValue(3);
> lblName.Text = param.Name.ToString();
> To get the names (you just change the number in GetValue). Here is
> what I found from this:
> FILENAME
> FILEEXTN
> PATH
> RENDER_FORMAT
> USERNAME
> WRITEMODE
> In addition, trial and error has shown me that:
> PASSWORD
> is what RS is expecting for the password.
> Try using these EXACTLY as shown here and see if it helps.
> Sheridan Saint-Michel
>|||I am having the same issue but with only PASSWORD though. all of my other
info is being passed. here is my code. any suggestions?
ParameterValue[] extensionParams2 = new ParameterValue[7];
extensionParams2[0] = new ParameterValue();
extensionParams2[0].Name = "FILENAME";
extensionParams2[0].Value = ScheduleName;
extensionParams2[1] = new ParameterValue();
extensionParams2[1].Name = "FILEEXTN";
extensionParams2[1].Value = "true";
//check if folder exists for User. If not then create
string strPath =ConfigurationManager.AppSettings["ReportsSchedulePath"].ToString()+ UserName;
if (!System.IO.Directory.Exists(strPath))
{
System.IO.Directory.CreateDirectory(strPath);
}
extensionParams2[2] = new ParameterValue();
extensionParams2[2].Name = "PATH";
extensionParams2[2].Value = strPath;
extensionParams2[3] = new ParameterValue();
extensionParams2[3].Name = "RENDER_FORMAT";
extensionParams2[3].Value = ReportType;
extensionParams2[4] = new ParameterValue();
extensionParams2[4].Name = "WRITEMODE";
extensionParams2[4].Value = "AutoIncrement";
extensionParams2[5] = new ParameterValue();
extensionParams2[5].Name = "USERNAME";
extensionParams2[5].Value =ConfigurationManager.AppSettings["FileShareUser"].ToString();
//extensionParams2[6] = new ParameterValue();
//extensionParams2[6].Name = "PASSWORD";
//extensionParams2[6].Label = "PASSWORD";
ParameterValue PW = new ParameterValue();
PW.Name = "PASSWORD";
PW.Value = ConfigurationManager.AppSettings["FileSharePass"].ToString();
//extensionParams2[6].Value =ConfigurationManager.AppSettings["FileSharePass"].ToString();
extensionParams2.SetValue(PW, 6);
ExtensionSettings extensionSettings2 = new ExtensionSettings();
extensionSettings2.Extension = "Report Server FileShare";
extensionSettings2.ParameterValues = extensionParams2;
string matchData = XML;
string txtResults2;
txtResults2 = schReport.CreateSubscription(ReportPath(),
extensionSettings2, ScheduleName, "TimedSubscription", matchData, paramaters);
return txtResults2;
also this worked when i first implimented this but has recently stopped
working. any security issues i should look at? i have SP1 and SP2 put on
Reporting services.
Josh