Re: Change report path in ReportViewer control



On Nov 21, 9:30 am, Larry Bud <larrybud2...@xxxxxxxxx> wrote:
I have a reportviewer control. I programmatically set the local
report path based on a drop down on a page. This allows the user to
choose which format (RDLC file) to use when generating the report.

The first request, the report processes properly, however if I choose
a different report format, the old report still renders. I'm doing
a .refresh for the report...

I tried turning off Viewstate for the report, but it says that
Viewstate must be true for the ReportViewer control.

If I "reenter" the page as new (such as by clicking on my menu item
for that page), it will then run the first report type chosen.

I'm changing the local report path such as

ReportViewer1.LocalReport.ReportPath = "myreport1.rdlc"
or
ReportViewer1.LocalReport.ReportPath = "myreport2.rdlc"

Any ideas?

It never fails that I ALWAYS find the answer to my question 10 minutes
after I post...

Must do a

ReportViewer1.LocalReport.Reset()

first. Then set your reportpaths, then do a
ReportViewer1.LocalReport.Refresh()

You must have VS2005 SP1 for this.
.



Relevant Pages

  • Re: Bug in Access 2002 Reports
    ... from within the Detail Section format event ... This will give the report a feeling of being "to scale", when you look at it you can see there are smaller, larger or equal intervals. ... Access will format the section but it will remember the last placement of the controls. ...
    (microsoft.public.access.reports)
  • Re: Emailing a Report
    ... "What do you suggest for making sure text on the report is not overlapping, missing, and or out of order? ... I always add icons to my toolbars to make it easier to format forms and reports... ... Align Right -- must have>1 control selected to be enabled ... on the report -- when it generates the reports, if a User_ID has 2 reminders, are they now both showing up on the report? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Rowsource of unbound object
    ... That is because the Format function returns a string. ... This works in a query, not sure how it will work for your Gantt Chart ... The report events are Open, Close, Activate, Deactivate, No Data, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Problems with exporting controls with borders to .rtf
    ... > With a report, you can use subreports to represent the ... >>Report after it's exported you may want to try exporting ... >>"Microsoft Security Announcement: Have you installed the ... >>editable format such as .rtf, ...
    (microsoft.public.access.reports)
  • Re: Converting decimal time into hh:nn:ss time in ACCESS
    ... around this issue by changing the format from 'mmmm yyyy' (this is how ... decimal field and it gives me the entire month total for each employee. ... I create a report to bring in all of the ... reformat the decimal time to hh:nn:ss with no problem as long as it is ...
    (microsoft.public.access.formscoding)