Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Monday, March 12, 2012

Programming Subscription Options

Hello,
We are developing our own ASP.NET 2.0 (C#) front-end for Reporting Services. We are trying to create an interface for setting up standard subscriptions that is similar to Report Manager.

On Report Manager's Report Server File Share options page, there are two options Render Format and Overwrite options that we need help with. Can we query the ReportServer and get the available Render Formats to populate a dropdownlist? Or, do we have to hard-code the values?

Same for the Overwrite options, are these hard-coded? Or, can the valid values be retreived from ReportServer?

Finally, on the Report Server E-mail setup page, there is a Priority field that we need to replicate. Again, are the valid values hard-coded into the dropdownlist or retreived from the ReportServer?

Thanks.I answered this in the newsgroup but will post my answer here as well.

You can call GetExtensionSettings to get the settings that a delivery
extension accepts. The extensions will return a populated list of renders
that it supports as well as the full set of options that it supports.

Programming Subscription Options

Hello,
We are developing our own ASP.NET 2.0 (C#) front-end for Reporting Services.
We are trying to create an interface for setting up standard subscriptions
that is similar to Report Manager.
On Report Manager's Report Server File Share options page, there are two
options Render Format and Overwrite options that we need help with. Can we
query the ReportServer and get the available Render Formats to populate a
dropdownlist? Or, do we have to hard-code the values?
Same for the Overwrite options, are these hard-coded? Or, can the valid
values be retrieved from ReportServer?
Finally, on the Report Server E-mail setup page, there is a Priority field
that we need to replicate. Again, are the valid values hard-coded into the
dropdownlist or retrieved from the ReportServer?
Thanks.You can call GetExtensionSettings to get the settings that a delivery
extension accepts. The extensions will return a populated list of renders
that it supports as well as the full set of options that it supports.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <nospam@.company.com> wrote in message
news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
> Hello,
> We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
> Services.
> We are trying to create an interface for setting up standard subscriptions
> that is similar to Report Manager.
> On Report Manager's Report Server File Share options page, there are two
> options Render Format and Overwrite options that we need help with. Can
> we
> query the ReportServer and get the available Render Formats to populate a
> dropdownlist? Or, do we have to hard-code the values?
> Same for the Overwrite options, are these hard-coded? Or, can the valid
> values be retrieved from ReportServer?
> Finally, on the Report Server E-mail setup page, there is a Priority field
> that we need to replicate. Again, are the valid values hard-coded into
> the
> dropdownlist or retrieved from the ReportServer?
> Thanks.
>|||Thanks Daniel!
Another quick question for you...
How does Report Manager validate that the Path is in Uniform Naming
Convention (UNC) format? More than likely, our end users will enter
something like: D:\Product\Reports, and I guess we'll need to validate it.
"Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
news:%23wXU5iE$FHA.216@.TK2MSFTNGP15.phx.gbl...
> You can call GetExtensionSettings to get the settings that a delivery
> extension accepts. The extensions will return a populated list of renders
> that it supports as well as the full set of options that it supports.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "sam" <nospam@.company.com> wrote in message
> news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
> > Hello,
> > We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
> > Services.
> > We are trying to create an interface for setting up standard
subscriptions
> > that is similar to Report Manager.
> >
> > On Report Manager's Report Server File Share options page, there are two
> > options Render Format and Overwrite options that we need help with. Can
> > we
> > query the ReportServer and get the available Render Formats to populate
a
> > dropdownlist? Or, do we have to hard-code the values?
> >
> > Same for the Overwrite options, are these hard-coded? Or, can the valid
> > values be retrieved from ReportServer?
> >
> > Finally, on the Report Server E-mail setup page, there is a Priority
field
> > that we need to replicate. Again, are the valid values hard-coded into
> > the
> > dropdownlist or retrieved from the ReportServer?
> >
> > Thanks.
> >
> >
>|||We don't validate all UNC paths, I believe it just checks that it starts
with \\
No real magic. :)
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <nospam@.company.com> wrote in message
news:%236XyizE$FHA.1312@.TK2MSFTNGP09.phx.gbl...
> Thanks Daniel!
> Another quick question for you...
> How does Report Manager validate that the Path is in Uniform Naming
> Convention (UNC) format? More than likely, our end users will enter
> something like: D:\Product\Reports, and I guess we'll need to validate it.
>
> "Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
> news:%23wXU5iE$FHA.216@.TK2MSFTNGP15.phx.gbl...
>> You can call GetExtensionSettings to get the settings that a delivery
>> extension accepts. The extensions will return a populated list of
>> renders
>> that it supports as well as the full set of options that it supports.
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>> "sam" <nospam@.company.com> wrote in message
>> news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
>> > Hello,
>> > We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
>> > Services.
>> > We are trying to create an interface for setting up standard
> subscriptions
>> > that is similar to Report Manager.
>> >
>> > On Report Manager's Report Server File Share options page, there are
>> > two
>> > options Render Format and Overwrite options that we need help with.
>> > Can
>> > we
>> > query the ReportServer and get the available Render Formats to populate
> a
>> > dropdownlist? Or, do we have to hard-code the values?
>> >
>> > Same for the Overwrite options, are these hard-coded? Or, can the
>> > valid
>> > values be retrieved from ReportServer?
>> >
>> > Finally, on the Report Server E-mail setup page, there is a Priority
> field
>> > that we need to replicate. Again, are the valid values hard-coded into
>> > the
>> > dropdownlist or retrieved from the ReportServer?
>> >
>> > Thanks.
>> >
>> >
>>
>

Programmatically setting UpdateParameters for a SQLDataSource control

I need to provide defaultsand sometimes overrides for items in SQLDataSource's UpdateParameters. I am attempting to do this in a FormView's ItemUpdating and ItemInserting events as follows:

//======================================================================== // FormView1_ItemUpdating: //========================================================================protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {// not sure if this is the bets place to put this or not? dsDataSource.UpdateParameters["UpdatedTS"].DefaultValue = DateTime.Now.ToString(); dsDataSource.UpdateParameters["UpdatedUserID"].DefaultValue = ((csi.UserInfo)Session["UserInfo"]).QuotaUserID; } 
In the example above I am attempting to set new values for the parameters which will replace the existing values.
I have found that using the DefaultValue property works ONLY if there is no current value for the parameter. Otherwise the values I specify are ingnored.
The parameters of an ObjectDataSource provide aValue property but SQLDataSource parameters do not.
How can I provide an override value without needing to place the value in the visible bound form element?

If you can answer this you will be the FIRST person ever to answer one of my questions here!!!
Thanks,
Tony
 

I figured it out. I still don't know if this is the best way to provide defaults but this works. If anyone has a better method I would appreciate any input

You can use the NewValues property of FormViewUpdateEventArgs and the Values property of FormViewInsertEventArgs

//======================================================================== // FormView1_ItemUpdating: //========================================================================protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {// not sure if this is the bets place to pout this or not? e.NewValues["UpdatedTS"] = DateTime.Now.ToString(); e.NewValues["UpdatedUserID"] = ((csi.UserInfo)Session["UserInfo"]).QuotaUserID; }

programmatically setting package variables in job step command line

We are trying to start a server job running an SSIS package and supply some parameters to the package when we start the job using SMO.

What we have now is this:

string cmdLine = job.JobSteps[0].Command;

cmdLine += @." /SET \Package\GetGroupRatingYear_Id.Variables[User::RatingId].Value;1";

cmdLine += @." /SET \Package\GetGroupRatingYear_Id.Variables[User::GroupId].Value;1";

cmdLine += " /SET \\Package.Variables[User::period].Value;\"" + periodEndDate + "\"";

job.JobSteps[0].Command = cmdLine;

job.Start();

It appears that when the job is run, the modified command line is not used.

What is needed to supply runtime parameters to a job step when starting the job via SMO?

Thanks,

So managing a job in this way seems a bit of a pain. Why not let the package go and get the values from an external location when it is required.

One example would be to use a package configuration, perhaps using a SQL Server configuration. You could update the table values, and then just design the package to use that configuration value, assigning the values to the variables as required. Read up on package configurations if you are not familiar with them.

A variation on the theme it to do the work yourself. You could use any table, not just a configuration format table. Use an Execuite SQL Task to query for the values and using the result set option, you can return values and on the results page of the task, set the output to variable values.

|||

Yes it's been a learning curve in how to do what we're trying to do. The application is driven by a web page where the user says 'run this job, use these parameters'. However, you can't have one predefined job with multiple instances on the server, each with their own set of parameters - which needs to be possible because of the application requirements.

What we are doing now that seems to work is creating a new job, setting the type to ssis, setting the command line to specify the package and parameters, and then starting the job. It is also set to auto delete upon success.

The other way we thought of but decided against was to have the job pick up its runtime parameters from a queue - but then we'd have to create and manage the queue.

The 'create new job' approach lets us run now or set a schedule to run later, all the instances are visible as jobs on the server (based on category to filter out for the UI), and they clean up themselves if they run successfully.

NB: if anyone is curious, changing the command line of an existing job requires the Alter() method to persist the change back to the server, otherwise it just runs with the original command. like this:

string cmdLine = job.JobSteps[0].Command;
cmdLine += @." /SET \Package\GetGroupRatingYear_Id.Variables[User::RatingId].Value;1";
job.JobSteps[0].Command = cmdLine;
job.JobSteps[0].Alter();
job.Start();

However, this permanently changes the command line in the job of course and you have to deal with that.

The code that that we're using to dynamically create the job and supply the parameters is pretty close to this:

string jobName = "the name to give to the new job";
string cmdLine = "the command line to run the package and set parameters";
ServerConnection svrConnection = new ServerConnection(sqlConnection);
Server svr = new Server(svrConnection);
JobServer agent = svr.JobServer;
if (agent.Jobs.Contains(jobName))
{
agent.Jobs[jobName].Drop();
}

job = new Job(agent, jobName);
job.DeleteLevel = CompletionAction.OnSuccess;
job.Category = "Calculate";
JobStep js = new JobStep(job, "Step 1");
js.SubSystem = AgentSubSystem.Ssis;
js.Command = cmdLine;
job.Create();
js.Create();
job.ApplyToTargetServer("(local)");
job.Alter();
job.Start();

Saturday, February 25, 2012

Programatticaly setting up history snapshot schedule

I am trying to do this with a web service but cant seem to figure out how,
as there is no direct method or function for it, it seems. But I have a
report I created programatically through the web services. Now I want to set
up a history snapshot schedule for it, I already have schedules set up on
the server as shared schedules, but now I need to tie them to the report to
have them execute according to the schedule. Any ideas on how to do this?
Google wasnt much help to me in finding info. thanks!Is this particular report is going to be fixed for running from a snapshot ?
In that case go to Report manager and select that particular
report->Properties ->execution and select "Render this report from a report
execution snapshot"
Amarnath, MCTS
"Smokey Grindel" wrote:
> I am trying to do this with a web service but cant seem to figure out how,
> as there is no direct method or function for it, it seems. But I have a
> report I created programatically through the web services. Now I want to set
> up a history snapshot schedule for it, I already have schedules set up on
> the server as shared schedules, but now I need to tie them to the report to
> have them execute according to the schedule. Any ideas on how to do this?
> Google wasnt much help to me in finding info. thanks!
>
>|||Unfortinuatly that doesnt solve my problem of how to do it programatically,
which is what I was trying to find out, but I eventually found the web
service method SetReportHistoryOptions
"Amarnath" <Amarnath@.discussions.microsoft.com> wrote in message
news:87D6EAAC-C394-4A82-9140-F3FE9B30F8F3@.microsoft.com...
> Is this particular report is going to be fixed for running from a snapshot
> ?
> In that case go to Report manager and select that particular
> report->Properties ->execution and select "Render this report from a
> report
> execution snapshot"
> Amarnath, MCTS
> "Smokey Grindel" wrote:
>> I am trying to do this with a web service but cant seem to figure out
>> how,
>> as there is no direct method or function for it, it seems. But I have a
>> report I created programatically through the web services. Now I want to
>> set
>> up a history snapshot schedule for it, I already have schedules set up
>> on
>> the server as shared schedules, but now I need to tie them to the report
>> to
>> have them execute according to the schedule. Any ideas on how to do this?
>> Google wasnt much help to me in finding info. thanks!
>>

Programaticly setting the value of a Select Query Property.

I have a query in which I'd like to use the username of the user currently logged in. The expression im using to retrieve the username is: Membership.GetUser().UserName.
Currently I have the following:
<asp:SqlDataSource ID="ProjectSource" runat="server" ConnectionString="<%$ ConnectionStrings:Code %>"
ProviderName="<%$ ConnectionStrings:Code.ProviderName %>" SelectCommand="Select Name, Namespace from Project where User = $Username">
<SelectParameters>
<asp:Parameter DefaultValue="" Name="$Username" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="ProjectSource" />

I'd somehow like to set up $Username to be equivlent to Membership.GetUser().UserName.I'd be interested to hear of a better way, however, currently, I cheat. I stuff things like that when they authenticate to session variables (I only have 3 in my current project). Then I pull them in the sqldatasources from there.|||Yeah, my solution doesnt look to be much better. Currently Im Setting the default value every time I need to execute a query.

Programatically setting the sub-report to load

My system uses a variety of invoice templates for each client, so 'Bank A' would have one invoice type sent to it, and 'Bank B' would have another etc. Each invoice template is a report, and they can vary quite substantially.

Each month the accounts team need to print out all the invoices for a month. I would like to create a report which has the invoices as a sub-report, so they can all be exported together and printed together.

However each sub-report could obviously be a different invoice-template. I notice that the sub-report selector field is one of the only fields that doesn't take an expression. Is there a way to programatically set which sub-report is used? The parameter sent to each report type is always the same (the primary key of the invoice to report on).

Any ideas? Or any other methods which would achieve the same goals?

Thanks,

Paul

One way is to add all subreport-types you could ever need to your report and hide all but the one you need dynamically via the hidden-expression..|||

Yes I could see that working, but it is pretty messy. As I would like the facility to just add extra invoice-template reports at any time. But with your method I'd have to also modify the main list report.

Thanks for your help anyway :)

programatically setting reportViewer datasource

I'm trying to set the DataSource of a ReportViewer programmatically. I'm doing the following but I'm getting the error

  • "A data source instance has not been supplied for the data source 'DataSet1_ORG'". DataSet1_Org is the xml datasource that the .rdlc is bound to.With ReportViewer1 Dim rdsAsNew ReportDataSource("rdsReport","sqlReport") 'sqlReport is a SQLDataSource on the webform

    .LocalReport.DataSources.Clear()

    .LocalReport.DataSources.Add(rds)

    .LocalReport.ReportPath = Server.MapPath("MyReport.rdlc")

    End With

    I know I'm close...it's just a bit elusive.

    Thanks, Alex

    What you can try is go to the Report menu, then to the Data Sources option, remove what is there and add the appropriate data source again.

    |||

    Hello

    you need to click on the reportviewer and select the choose data source and select the datasource that u want

  •