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

No comments:

Post a Comment