Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Friday, March 23, 2012

Report Viewer Control in Local Mode ?

I run my reports in local mode and do something like this :

Code Snippet

//Local Processing mode for Reports

reportViewer.ProcessingMode = ProcessingMode.Local;

// Set RDL file based on handout/grid selected

if (gridRadioButton.Checked)

{

reportViewer.LocalReport.ReportPath = "Grid.rdlc";

}

else

{

//Handout

reportViewer.LocalReport.ReportPath = "Handout.rdlc";

}

//Refresh the report in order to show it to the user.

reportViewer.RefreshReport();

The problem is that both handout and grid is diiferent, Say User Selects the grid once it always shows the grid report. Even second time you change to handout still it shows the same Grid format and I debugged it and it picks the new report path but doesn't help? The application needs to be rerun to fix it.

Can anyone explain what is causing this and how to get rid of it.

Thanks,

Harsimrat

There are a couple of things you need to do:

1) I assume that the user can move back and forth between the reports at will? Not just change once? Therefore you should be checking to see if the user has actually *changed* before doing the appropriate reinitialization (IOW, do a comparison between current and new values)...

2) Reinitialization looks something like this:

Use the ReportViewer.Reset() method -- this is probably the bit you are missing Set the appropriate ReportPath, assuming these are not embedded resources, otherwise you want to set that Rebind the datasources -- this may or may not be required|||I tried adding Reset() and then it tells me cannot find the dataset. But without Reset() it runs fine. I think I need to rebind it somehow as my initial binding is done automatically. If you can please give an code example ?|||

Um, I did say you probably needed to re-bind... I think...

I would forget about the "automatically" bound altogether if you are switching between reports. But this is one of the reasons I told you to check to see whether they had actually *switched* reports -- because you don't want to do the reset and rebind if they have chosen the same report twice in a row. Does that make sense?

I will show you a code example in two parts. The first part shows you where I am actually refreshing the data, previous to changing the report. In my case the procedures for doing so are different depending on whether the source is a local XML file or from a data server --

I will pseudo code some parts of it that are not relevant to you... but this happens to be the reason why I need to switch reports in this particular form.... it doesn't matter that your reason is different, as it will still give you the idea of what you need to do, even in cases (like mine) that the datasets might be entirely different.

Code Snippet

If tsSourceIsServerInfo Then
Me.GetDataSetFromServer()
If [...] the last time they used a different report Then

Me.ReinitializeViewer(tThisReportName)
Else
Me.ReportViewer1.Visible = True ' it might not have been previously
End If
Else
Me.DataSet1.Reset()
Me.DataSet1.ReadXml(tsSource)
If [...] the last time they used a different report as above Then

Me.ReinitializeViewer(tThisReportName)
Else
Me.ReportViewer1.Visible = True
End If
End If

' carry on with initializing params here, then

Me.ReportViewer1.RefreshReport()

OK so far?

You see that the re-initialization is only done where necessary. Now for what happens inside the initialization:

Code Snippet

Private Sub ReinitializeViewer(ByVal tsReport As String)
Dim ReportDataSourceX = _

New Microsoft.Reporting.WinForms.ReportDataSource()
Me.ReportViewer1.Reset()
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = tsReport

' change above line to

' Me.ReportViewer1.LocalReport.ReportPath = tsReport

' if not embedded

If tsReport is a certain report Then

ReportDataSourceX.Name = "Appropriate name for the data set for it"
ReportDataSourceX.Value = Me.BindingSourceDatabase
Else
ReportDataSourceX.Name = "Appropriate name here"
ReportDataSourceX.Value = Me.BindingSourceXML
End If


Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSourceX)
Me.ReportViewer1.Visible = True

End Sub

HTH,

>L<

Wednesday, March 21, 2012

Report Throttling and Asynch Processing

My enterprise is looking into migrating to SSRS 2005 and I am trying to gather as much information as possible. One area that I've been unable to find much information is around the area of process (or report request) throttling inherent to SSRS. We are a large organization and the reporting technology that we choose must be able to process thousands of report requests a day. In our current solution, we have the ability to throttle the report requests so that a limit is placed on the number of report request that can be processed concurrently so that the reporting infrastructure is not overwhelmed during peak load times. Subsequent request are queued for processing at a period when there is less load on the servers. Does SSRS have this capability and is it configurable? Is there any detailed information (articles, whitepapers, books) available addressing this subject?

This leads me to a second question concerning an asynchronous reporting solution. Has anyone developed a solution using SSRS that allows long running reports ( that are requested online) to be processed on a background thread and has the background thread alert the user when the report has completed? This is a nice feature of our current solution but I have not been able to find a comparable solution utilizing SSRS.There looks like there might be possibility in the Subscription capabilities but I’m not sure how this would work online requested reports.

Any help would be appreciated. Thanks!!

You can have users subscribe to reports so they are processed and pushed out during down time - either to email, or say to an ftp server. If you want a queuing feature for on demand though, you would have to front-end that. And you would need a mechanism to determine long running reports.

You can scale the infrastructure of RS and setup farms. Throttling though..not likely.

Yes, in your second question...have the user setup a subscription to the report. Then either email as an attachment or send as a link so they can retrieve it. Again, you might want to front end this on an ASP page so the user makes their report selections and then a few lines of code creates the subscription for them...providing the appearance of a request queue.

|||Thanks David.

I will definitely research these options. On the surface, I don't think that attaching the reports to emails is a valid option for us because of the size of the files. In the situations where you include a link to the report, how is this being secured? Is the link to the Report Manager site with URL access? Or is the report output saved to a share with the link taking the user to a share? If it is persisted to a share, how are these files secured? How are the user and calling application notified of a failure?

Looks like a combination of subscription and custom delivery extension might be the answer.

Thanks for the help and sorry about all the questions.

|||

David,

In the case of Scheduling, does it do any throttling in that case? What if I schedule 200 reports for the same time? Will it run all 200 at once or will it be smart about it and do something to prevent this from hurting the performance of the entire system?

Mark

|||

swfranklin wrote:

Thanks David.

I will definitely research these options. On the surface, I don't think that attaching the reports to emails is a valid option for us because of the size of the files. In the situations where you include a link to the report, how is this being secured? Is the link to the Report Manager site with URL access? Or is the report output saved to a share with the link taking the user to a share? If it is persisted to a share, how are these files secured? How are the user and calling application notified of a failure?

Looks like a combination of subscription and custom delivery extension might be the answer.

Thanks for the help and sorry about all the questions.

You have a choice in output. You can send to a file share and manage the security on your own using Windows/AD / ftp folder...etc.
Or you can supply a link to the report in the email..in which case you'd be setting up security on the Report Server and the user gets authenticated when they click the link.

By failure..it depends upon what you mean. This would be report creation, not batch programming. Errors I have seen are email (address or server not being set up correctly)..in that case, no mail. Something like your dataset becomes unavailable? Other than that there really isn't much to subscriptions. A report is set to generate at 9AM and if I don't receive it in a timely manner I contact someone..If your report is first dependent upon say, a cube processing after a long ETL to a datawarehouse and that bombed...you would have to build some custom mechanism to alert your users. That would be outside of the scope of SSRS.

sql

Tuesday, March 20, 2012

report starts processing immediately

Hello,
my report starts processing immediately when I switch to preview window in
VS (or click on it in the Web Browser).
I know it's because it has some string parameters (with list of available
values and default value defined) & 2 datetime parameters that allow null
values. When I remove default values or uncheck "allow null value" the
report waits untill I specify params. I suppose it is not convenient to work
with. Happily, my report calculates fast.
Are you going to fix this in the future releases?fix what?
This isn't desired behavior?
"Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
news:ew9ITm$bEHA.2812@.TK2MSFTNGP11.phx.gbl...
> Hello,
> my report starts processing immediately when I switch to preview window in
> VS (or click on it in the Web Browser).
> I know it's because it has some string parameters (with list of available
> values and default value defined) & 2 datetime parameters that allow null
> values. When I remove default values or uncheck "allow null value" the
> report waits untill I specify params. I suppose it is not convenient to
work
> with. Happily, my report calculates fast.
> Are you going to fix this in the future releases?
>|||Ok, suppose, I want a report that can be for the last week, last month or
any other period that the user can specify (the fisrt two options is for
subscription). I'm creating 3 params: period type (last week, last month,
other) and two datetime parameters -- start date, end date (checking "allow
null value" to use them in subscriptions. Did I do anything wrong? May be
there is a better way?
"G" <brian.grant@.si-intl-kc.com> ñîîáùèë/ñîîáùèëà â íîâîñòÿõ ñëåäóþùåå:
news:OxrbQu$bEHA.808@.tk2msftngp13.phx.gbl...
> fix what?
> This isn't desired behavior?
>
> "Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
> news:ew9ITm$bEHA.2812@.TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > my report starts processing immediately when I switch to preview window
in
> > VS (or click on it in the Web Browser).
> >
> > I know it's because it has some string parameters (with list of
available
> > values and default value defined) & 2 datetime parameters that allow
null
> > values. When I remove default values or uncheck "allow null value" the
> > report waits untill I specify params. I suppose it is not convenient to
> work
> > with. Happily, my report calculates fast.
> >
> > Are you going to fix this in the future releases?
> >
> >
>|||I too have seen this behavior and agree that it is not the best. Just
because I have assigned defaults to the parameters does not mean I want it
to execute without any intervention on the users part. They should need to
click, hit enter. I.e. they should have to do the same thing they do after
selecting a parameter for the report to run. So, I did as you did. I leave
at least one report without a default so it waits for user interaction
before running.
Bruce L-C
"Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
news:e0e%23mJAcEHA.3300@.TK2MSFTNGP09.phx.gbl...
> Ok, suppose, I want a report that can be for the last week, last month or
> any other period that the user can specify (the fisrt two options is for
> subscription). I'm creating 3 params: period type (last week, last month,
> other) and two datetime parameters -- start date, end date (checking
"allow
> null value" to use them in subscriptions. Did I do anything wrong? May be
> there is a better way?
> "G" <brian.grant@.si-intl-kc.com> ñîîáùèë/ñîîáùèëà â íîâîñòÿõ ñëåäóþùåå:
> news:OxrbQu$bEHA.808@.tk2msftngp13.phx.gbl...
> > fix what?
> >
> > This isn't desired behavior?
> >
> >
> > "Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
> > news:ew9ITm$bEHA.2812@.TK2MSFTNGP11.phx.gbl...
> > > Hello,
> > >
> > > my report starts processing immediately when I switch to preview
window
> in
> > > VS (or click on it in the Web Browser).
> > >
> > > I know it's because it has some string parameters (with list of
> available
> > > values and default value defined) & 2 datetime parameters that allow
> null
> > > values. When I remove default values or uncheck "allow null value" the
> > > report waits untill I specify params. I suppose it is not convenient
to
> > work
> > > with. Happily, my report calculates fast.
> > >
> > > Are you going to fix this in the future releases?
> > >
> > >
> >
> >
>|||It would be good to have an option to execute the report automatically
or not when the parameters are all valid.
In my case - after the user has selected all the parameters, he still
has to click 'view report' in the browser. I wish I could set it that
any parameter he changes, as long they are valid... execute the query.
My queries are small.. and go to OLAP... so are very quick.
People like to see action without much effort!!
And of course - sometimes it is better to click the view report -
specially if the query is large...