Showing posts with label viewer. Show all posts
Showing posts with label viewer. Show all posts

Wednesday, March 7, 2012

Local Report not changing back to original report

Hi
I have an aspx page which contains the report viewer control. I am using
this control in local processing mode.
Everything is working correctly except the following case
If I view a report (Report1) and then click on a hyperlink which drills down
to another report (Report2), the new report loads corectly and the
parameters are passed.
However, If I then select my generate report button on the form, it seems to
create the correct datasource and pass the right parameters, but instead of
displaying Report1 again, Report2 is still displayed and the data in the
report is incorrect.
I have dubugged the code and it all seems correct to me.When the generate
report button is clicked, the report path for Report1 is set, the new
collection of report parameters are created (which are correct) and the
datasources are setup.
The only thing that is not changing correctly is the report being rendered.
Here is some of my code
'btnGenerateReport_Click Method
rptReportViewer.LocalReport.ReportPath = MapPath("../Reports/" &
objReport.URL & ".rdlc")
rptReportViewer.LocalReport.DisplayName = objReport.Name
rptReportViewer.LocalReport.DataSources.Clear()
rptReportViewer.LocalReport.DataSources.Add(New
Microsoft.Reporting.WebForms.ReportDataSource("myDataset",
dsData.Tables(0)))
rptReportViewer.LocalReport.SetParameters(objReportParameters)
rptReportViewer.LocalReport.Refresh()
rptReportViewer.Visible = True
Is there anything else I need to do to refresh the report?
Any help would reeally be appreciated as I cannot find any help or examples
on how to do this.
Thanks
Lewis HolmesHi Lewis,
Thank you for your post.
This behavior is by design for the WebForm.ReportViewer control.
It is possible to change the DataSource of the localreport
It is not possible to change the report definition in the WebForms control
in LocalReport mode after it has been set once.
To work around the design limitation of the WebForms ReportViewer control,
you can remove the existing instance and create a new one which uses the
new report definition.
Here is a sample:
//Get the new report definition
StreamReader tr = new StreamReader( < your rdlc file path>);
string sDef = tr.ReadToEnd();
tr.Close();
//Create the new viewer and remove the old one
ControlCollection col = ReportViewer1.Parent.Controls;
int index = col.IndexOf(ReportViewer1);
ReportViewer newReportView = new ReportViewer();
col.AddAt(index, newReportView);
col.Remove(ReportViewer1);
newReportView.Visible = false;
newReportView.ProcessingMode = ProcessingMode.Local;
StringReader sr = new StringReader(sDef);
newReportView.LocalReport.LoadReportDefinition(sr);
newReportView.LocalReport.DataSources.Clear();
newReportView.LocalReport.DataSources.Add(new
Microsoft.Reporting.WebForms.ReportDataSource("DataSet1_DataTable1",
ObjectDataSource1));
newReportView.LocalReport.Refresh();
newReportView.Visible = true;
Hope this will be helpful!
Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Local report from local dataset

Hi,
I have some experience with RS 2000, but just started 2005.
I am trying to incorporate reports into my application using report viewer,
no server.
I will report from the data set that I created inside of my app. It is also
possible that based on user's input some fields can be suppressed.
I know that I can use business objects, but it looks like I have everything
in my data set. So, can I build my report(s) from this data set in design
time (how can I see my data set as data source?)?
And another question, is there any API to manipulate controls on report
during design time? I spent a lot of time with Crystal - I can do this there.
I hope RS has something like this or even better.
Thanks.Something like the code below. What APIs do you need at design time?
' Load the dataset
adapter.Fill(dataset)
' Local report
reportViewer.ProcessingMode = ProcessingMode.Local
reportViewer.LocalReport.EnableHyperlinks = True
' Set RDL file
reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
' Supply a DataTable for the report data source
reportViewer.LocalReport.DataSources.Add(New
ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
' Set the report parameters. Notice that the parameters array is 0-based,
hence (1) for two parameters
Dim parameters(1) As ReportParameter
parameters(0) = New ReportParameter("Year", 2003)
parameters(1) = New ReportParameter("NumberMonths", 3)
reportViewer.LocalReport.SetParameters(parameters)
reportViewer.RefreshReport()
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Victor" <Victor@.discussions.microsoft.com> wrote in message
news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> Hi,
> I have some experience with RS 2000, but just started 2005.
> I am trying to incorporate reports into my application using report
> viewer,
> no server.
> I will report from the data set that I created inside of my app. It is
> also
> possible that based on user's input some fields can be suppressed.
> I know that I can use business objects, but it looks like I have
> everything
> in my data set. So, can I build my report(s) from this data set in design
> time (how can I see my data set as data source?)?
> And another question, is there any API to manipulate controls on report
> during design time? I spent a lot of time with Crystal - I can do this
> there.
> I hope RS has something like this or even better.
> Thanks.|||Thank you Teo,
API to hide/show/change/etc. fields or any items. Probably it can be done by
manipulating XML file .rdlc, but is there any API for this already?
Also, can I build my own dataset and then based on it build my report,
during design time and during run time?
And Teo, are you going to write another book on SSRS, but now based on 2005?
Thanks.
"Teo Lachev [MVP]" wrote:
> Something like the code below. What APIs do you need at design time?
> ' Load the dataset
> adapter.Fill(dataset)
> ' Local report
> reportViewer.ProcessingMode = ProcessingMode.Local
> reportViewer.LocalReport.EnableHyperlinks = True
> ' Set RDL file
> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
> ' Supply a DataTable for the report data source
> reportViewer.LocalReport.DataSources.Add(New
> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
> ' Set the report parameters. Notice that the parameters array is 0-based,
> hence (1) for two parameters
> Dim parameters(1) As ReportParameter
> parameters(0) = New ReportParameter("Year", 2003)
> parameters(1) = New ReportParameter("NumberMonths", 3)
> reportViewer.LocalReport.SetParameters(parameters)
> reportViewer.RefreshReport()
>
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> > Hi,
> > I have some experience with RS 2000, but just started 2005.
> > I am trying to incorporate reports into my application using report
> > viewer,
> > no server.
> > I will report from the data set that I created inside of my app. It is
> > also
> > possible that based on user's input some fields can be suppressed.
> >
> > I know that I can use business objects, but it looks like I have
> > everything
> > in my data set. So, can I build my report(s) from this data set in design
> > time (how can I see my data set as data source?)?
> >
> > And another question, is there any API to manipulate controls on report
> > during design time? I spent a lot of time with Crystal - I can do this
> > there.
> > I hope RS has something like this or even better.
> >
> > Thanks.
>
>|||The APIs are XML DOM. since RDL is XML-based. If you have too much
manipulation to do, consider buiding an object model on top of it. That's
what I am doing for my currect project. Yes, you can use VS.NET 2005 to
design your report.
About the book...I decided to skip 2005. The new one is about SSAS 2005 and
BI (http://www.prologika.com/Books/0976635305/Book.aspx)
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Victor" <Victor@.discussions.microsoft.com> wrote in message
news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
> Thank you Teo,
> API to hide/show/change/etc. fields or any items. Probably it can be done
> by
> manipulating XML file .rdlc, but is there any API for this already?
> Also, can I build my own dataset and then based on it build my report,
> during design time and during run time?
> And Teo, are you going to write another book on SSRS, but now based on
> 2005?
> Thanks.
>
> "Teo Lachev [MVP]" wrote:
>> Something like the code below. What APIs do you need at design time?
>> ' Load the dataset
>> adapter.Fill(dataset)
>> ' Local report
>> reportViewer.ProcessingMode = ProcessingMode.Local
>> reportViewer.LocalReport.EnableHyperlinks = True
>> ' Set RDL file
>> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> ' Supply a DataTable for the report data source
>> reportViewer.LocalReport.DataSources.Add(New
>> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> ' Set the report parameters. Notice that the parameters array is 0-based,
>> hence (1) for two parameters
>> Dim parameters(1) As ReportParameter
>> parameters(0) = New ReportParameter("Year", 2003)
>> parameters(1) = New ReportParameter("NumberMonths", 3)
>> reportViewer.LocalReport.SetParameters(parameters)
>> reportViewer.RefreshReport()
>>
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> > Hi,
>> > I have some experience with RS 2000, but just started 2005.
>> > I am trying to incorporate reports into my application using report
>> > viewer,
>> > no server.
>> > I will report from the data set that I created inside of my app. It is
>> > also
>> > possible that based on user's input some fields can be suppressed.
>> >
>> > I know that I can use business objects, but it looks like I have
>> > everything
>> > in my data set. So, can I build my report(s) from this data set in
>> > design
>> > time (how can I see my data set as data source?)?
>> >
>> > And another question, is there any API to manipulate controls on report
>> > during design time? I spent a lot of time with Crystal - I can do this
>> > there.
>> > I hope RS has something like this or even better.
>> >
>> > Thanks.
>>|||I am new to .Net and would appreciate little bit more clarification on
Victor's question as to 'How can I build my report(s) from this data
set in design
time (how can I see my data set as data source?)?. I am actually
planning to use DataReader and than load a DataTable with the reader
and use that as my Report Datasource. Any suggestion on the approach is
welcome.
Thanks,
Srivast
Teo Lachev [MVP] wrote:
> The APIs are XML DOM. since RDL is XML-based. If you have too much
> manipulation to do, consider buiding an object model on top of it. That's
> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
> design your report.
> About the book...I decided to skip 2005. The new one is about SSAS 2005 and
> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
> > Thank you Teo,
> >
> > API to hide/show/change/etc. fields or any items. Probably it can be done
> > by
> > manipulating XML file .rdlc, but is there any API for this already?
> >
> > Also, can I build my own dataset and then based on it build my report,
> > during design time and during run time?
> >
> > And Teo, are you going to write another book on SSRS, but now based on
> > 2005?
> >
> > Thanks.
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> >> Something like the code below. What APIs do you need at design time?
> >>
> >> ' Load the dataset
> >>
> >> adapter.Fill(dataset)
> >>
> >> ' Local report
> >>
> >> reportViewer.ProcessingMode = ProcessingMode.Local
> >>
> >> reportViewer.LocalReport.EnableHyperlinks = True
> >>
> >> ' Set RDL file
> >>
> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
> >>
> >> ' Supply a DataTable for the report data source
> >>
> >> reportViewer.LocalReport.DataSources.Add(New
> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
> >>
> >> ' Set the report parameters. Notice that the parameters array is 0-based,
> >> hence (1) for two parameters
> >>
> >> Dim parameters(1) As ReportParameter
> >>
> >> parameters(0) = New ReportParameter("Year", 2003)
> >>
> >> parameters(1) = New ReportParameter("NumberMonths", 3)
> >>
> >> reportViewer.LocalReport.SetParameters(parameters)
> >>
> >> reportViewer.RefreshReport()
> >>
> >>
> >> --
> >> HTH,
> >> ---
> >> Teo Lachev, MVP, MCSD, MCT
> >> "Microsoft Reporting Services in Action"
> >> "Applied Microsoft Analysis Services 2005"
> >> Home page and blog: http://www.prologika.com/
> >>
> >> ---
> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> >> > Hi,
> >> > I have some experience with RS 2000, but just started 2005.
> >> > I am trying to incorporate reports into my application using report
> >> > viewer,
> >> > no server.
> >> > I will report from the data set that I created inside of my app. It is
> >> > also
> >> > possible that based on user's input some fields can be suppressed.
> >> >
> >> > I know that I can use business objects, but it looks like I have
> >> > everything
> >> > in my data set. So, can I build my report(s) from this data set in
> >> > design
> >> > time (how can I see my data set as data source?)?
> >> >
> >> > And another question, is there any API to manipulate controls on report
> >> > during design time? I spent a lot of time with Crystal - I can do this
> >> > there.
> >> > I hope RS has something like this or even better.
> >> >
> >> > Thanks.
> >>
> >>
> >>|||I have done this and the code that Teo posted will work for you. What I have
found easiest is to design a report using the Reporting Services designer
(you can design without a server). The UI is much easier. Get the report to
work. Then copy over the rdl file renaming it to rdlc. Then use the control
setting it to the rdlc file and giving it your datatable. Note that in local
mode you have to handle subreports and other actions that are done for you
automatically in server mode. So, although you can do this, if you are using
the server product I would evaluate whether you really should do it.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Srivast" <sarita.srivastava@.avon.com> wrote in message
news:1133884592.106808.80610@.g43g2000cwa.googlegroups.com...
>I am new to .Net and would appreciate little bit more clarification on
> Victor's question as to 'How can I build my report(s) from this data
> set in design
> time (how can I see my data set as data source?)?. I am actually
> planning to use DataReader and than load a DataTable with the reader
> and use that as my Report Datasource. Any suggestion on the approach is
> welcome.
> Thanks,
> Srivast
>
> Teo Lachev [MVP] wrote:
>> The APIs are XML DOM. since RDL is XML-based. If you have too much
>> manipulation to do, consider buiding an object model on top of it. That's
>> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
>> design your report.
>> About the book...I decided to skip 2005. The new one is about SSAS 2005
>> and
>> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
>> > Thank you Teo,
>> >
>> > API to hide/show/change/etc. fields or any items. Probably it can be
>> > done
>> > by
>> > manipulating XML file .rdlc, but is there any API for this already?
>> >
>> > Also, can I build my own dataset and then based on it build my report,
>> > during design time and during run time?
>> >
>> > And Teo, are you going to write another book on SSRS, but now based on
>> > 2005?
>> >
>> > Thanks.
>> >
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> Something like the code below. What APIs do you need at design time?
>> >>
>> >> ' Load the dataset
>> >>
>> >> adapter.Fill(dataset)
>> >>
>> >> ' Local report
>> >>
>> >> reportViewer.ProcessingMode = ProcessingMode.Local
>> >>
>> >> reportViewer.LocalReport.EnableHyperlinks = True
>> >>
>> >> ' Set RDL file
>> >>
>> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> >>
>> >> ' Supply a DataTable for the report data source
>> >>
>> >> reportViewer.LocalReport.DataSources.Add(New
>> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> >>
>> >> ' Set the report parameters. Notice that the parameters array is
>> >> 0-based,
>> >> hence (1) for two parameters
>> >>
>> >> Dim parameters(1) As ReportParameter
>> >>
>> >> parameters(0) = New ReportParameter("Year", 2003)
>> >>
>> >> parameters(1) = New ReportParameter("NumberMonths", 3)
>> >>
>> >> reportViewer.LocalReport.SetParameters(parameters)
>> >>
>> >> reportViewer.RefreshReport()
>> >>
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >>
>> >> ---
>> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> >> > Hi,
>> >> > I have some experience with RS 2000, but just started 2005.
>> >> > I am trying to incorporate reports into my application using report
>> >> > viewer,
>> >> > no server.
>> >> > I will report from the data set that I created inside of my app. It
>> >> > is
>> >> > also
>> >> > possible that based on user's input some fields can be suppressed.
>> >> >
>> >> > I know that I can use business objects, but it looks like I have
>> >> > everything
>> >> > in my data set. So, can I build my report(s) from this data set in
>> >> > design
>> >> > time (how can I see my data set as data source?)?
>> >> >
>> >> > And another question, is there any API to manipulate controls on
>> >> > report
>> >> > during design time? I spent a lot of time with Crystal - I can do
>> >> > this
>> >> > there.
>> >> > I hope RS has something like this or even better.
>> >> >
>> >> > Thanks.
>> >>
>> >>
>> >>
>|||Precisely. Accidentally, I am working on a two-part article for DevX that
will cover the report viewers in more details. I will post an announcement
when it is published.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OVnkcBo%23FHA.1600@.TK2MSFTNGP11.phx.gbl...
>I have done this and the code that Teo posted will work for you. What I
>have found easiest is to design a report using the Reporting Services
>designer (you can design without a server). The UI is much easier. Get the
>report to work. Then copy over the rdl file renaming it to rdlc. Then use
>the control setting it to the rdlc file and giving it your datatable. Note
>that in local mode you have to handle subreports and other actions that are
>done for you automatically in server mode. So, although you can do this, if
>you are using the server product I would evaluate whether you really should
>do it.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Srivast" <sarita.srivastava@.avon.com> wrote in message
> news:1133884592.106808.80610@.g43g2000cwa.googlegroups.com...
>>I am new to .Net and would appreciate little bit more clarification on
>> Victor's question as to 'How can I build my report(s) from this data
>> set in design
>> time (how can I see my data set as data source?)?. I am actually
>> planning to use DataReader and than load a DataTable with the reader
>> and use that as my Report Datasource. Any suggestion on the approach is
>> welcome.
>> Thanks,
>> Srivast
>>
>> Teo Lachev [MVP] wrote:
>> The APIs are XML DOM. since RDL is XML-based. If you have too much
>> manipulation to do, consider buiding an object model on top of it.
>> That's
>> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
>> design your report.
>> About the book...I decided to skip 2005. The new one is about SSAS 2005
>> and
>> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
>> > Thank you Teo,
>> >
>> > API to hide/show/change/etc. fields or any items. Probably it can be
>> > done
>> > by
>> > manipulating XML file .rdlc, but is there any API for this already?
>> >
>> > Also, can I build my own dataset and then based on it build my report,
>> > during design time and during run time?
>> >
>> > And Teo, are you going to write another book on SSRS, but now based on
>> > 2005?
>> >
>> > Thanks.
>> >
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> Something like the code below. What APIs do you need at design time?
>> >>
>> >> ' Load the dataset
>> >>
>> >> adapter.Fill(dataset)
>> >>
>> >> ' Local report
>> >>
>> >> reportViewer.ProcessingMode = ProcessingMode.Local
>> >>
>> >> reportViewer.LocalReport.EnableHyperlinks = True
>> >>
>> >> ' Set RDL file
>> >>
>> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> >>
>> >> ' Supply a DataTable for the report data source
>> >>
>> >> reportViewer.LocalReport.DataSources.Add(New
>> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> >>
>> >> ' Set the report parameters. Notice that the parameters array is
>> >> 0-based,
>> >> hence (1) for two parameters
>> >>
>> >> Dim parameters(1) As ReportParameter
>> >>
>> >> parameters(0) = New ReportParameter("Year", 2003)
>> >>
>> >> parameters(1) = New ReportParameter("NumberMonths", 3)
>> >>
>> >> reportViewer.LocalReport.SetParameters(parameters)
>> >>
>> >> reportViewer.RefreshReport()
>> >>
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >>
>> >> ---
>> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> >> > Hi,
>> >> > I have some experience with RS 2000, but just started 2005.
>> >> > I am trying to incorporate reports into my application using report
>> >> > viewer,
>> >> > no server.
>> >> > I will report from the data set that I created inside of my app. It
>> >> > is
>> >> > also
>> >> > possible that based on user's input some fields can be suppressed.
>> >> >
>> >> > I know that I can use business objects, but it looks like I have
>> >> > everything
>> >> > in my data set. So, can I build my report(s) from this data set in
>> >> > design
>> >> > time (how can I see my data set as data source?)?
>> >> >
>> >> > And another question, is there any API to manipulate controls on
>> >> > report
>> >> > during design time? I spent a lot of time with Crystal - I can do
>> >> > this
>> >> > there.
>> >> > I hope RS has something like this or even better.
>> >> >
>> >> > Thanks.
>> >>
>> >>
>> >>
>|||I have used the code above to write a report browser. The first report
shows fine, only if I select a different repport the first report keeps
coming back. No errors no messages. This is the code I use. Does
anybody knows the solution?
Thank you,
Arjan
private void button1_Click(object sender, EventArgs e)
{
this.openFileDialog1.InitialDirectory =System.Reflection.Assembly.GetExecutingAssembly().Location;
DialogResult _result = this.openFileDialog1.ShowDialog();
if (_result == DialogResult.OK)
{
string _fileName =this.openFileDialog1.FileName.ToString();
if (Path.GetExtension(_fileName) == ".rdlc")
{
this.reportViewer1.ProcessingMode =ProcessingMode.Local;
FileStream _stream = File.OpenRead(_fileName);
this.reportViewer1.LocalReport.LoadReportDefinition(_stream);
_stream.Close();
foreach (string _dataSetName in
this.reportViewer1.LocalReport.GetDataSourceNames())
{
DataTable _dt = new DataTable();
SqlCommand _command = new SqlCommand("SELECT *
FROM " + _dataSetName.Replace("ProjectDataSet_", ""), new
SqlConnection("ConnectionString"));
_command.CommandType = CommandType.Text;
new SqlDataAdapter(_command).Fill(_dt);
ReportDataSource _reportDataSource = new
ReportDataSource();
_reportDataSource.Name = _dataSetName;
_reportDataSource.Value = _dt;
this.reportViewer1.LocalReport.DataSources.Add(_reportDataSource);
}
this.reportViewer1.RefreshReport();
}
else
{
MessageBox.Show("Invalid extension");
}
}
}|||Try reportViewer1.Reset() before rendering. Also, I noticed that you are
calling LoadReportDefinition. This method will render the report ad-hoc. I
think what you need here is just setting the ReportPath to your rdlc file,
e.g.
reportViewer1.LocalReport.ReportPath = "<myreportname>.rdlc"
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
<arjan@.synion.nl> wrote in message
news:1134056833.592280.285570@.g14g2000cwa.googlegroups.com...
>I have used the code above to write a report browser. The first report
> shows fine, only if I select a different repport the first report keeps
> coming back. No errors no messages. This is the code I use. Does
> anybody knows the solution?
> Thank you,
> Arjan
> private void button1_Click(object sender, EventArgs e)
> {
> this.openFileDialog1.InitialDirectory => System.Reflection.Assembly.GetExecutingAssembly().Location;
> DialogResult _result = this.openFileDialog1.ShowDialog();
> if (_result == DialogResult.OK)
> {
> string _fileName => this.openFileDialog1.FileName.ToString();
> if (Path.GetExtension(_fileName) == ".rdlc")
> {
> this.reportViewer1.ProcessingMode => ProcessingMode.Local;
> FileStream _stream = File.OpenRead(_fileName);
> this.reportViewer1.LocalReport.LoadReportDefinition(_stream);
> _stream.Close();
> foreach (string _dataSetName in
> this.reportViewer1.LocalReport.GetDataSourceNames())
> {
> DataTable _dt = new DataTable();
> SqlCommand _command = new SqlCommand("SELECT *
> FROM " + _dataSetName.Replace("ProjectDataSet_", ""), new
> SqlConnection("ConnectionString"));
> _command.CommandType = CommandType.Text;
> new SqlDataAdapter(_command).Fill(_dt);
> ReportDataSource _reportDataSource = new
> ReportDataSource();
> _reportDataSource.Name = _dataSetName;
> _reportDataSource.Value = _dt;
>
> this.reportViewer1.LocalReport.DataSources.Add(_reportDataSource);
> }
> this.reportViewer1.RefreshReport();
> }
> else
> {
> MessageBox.Show("Invalid extension");
> }
> }
> }
>|||Yes that did the trick! Thank you!
I want to alter a 'template' rdlc with new values and stream the result
to the reportviewer control. That is why I used the stream.
Does anyone know an opensource project 'rdl(c) file to class'? Input is
the path to an rdl(c) file, output is a class with all the settings in
the file. Simply alter class and stream class.ToSring() to the viewer.
Thank you,
Arjan|||I have noticed that the webform reportviewer does not have the Reset
method. What to do on a webform when changing reports in local mode?
Thank you,
Arjan|||We developed our own object wrapper on top of RDL. It is not that hard to do
given that the RDL spec is out there
(http://download.microsoft.com/download/c/2/0/c2091a26-d7bf-4464-8535-dbc31fb45d3c/rdlNov05.pdf)
and it really pays out in a long run. http://www.fyireporting.com/ could be
a good start.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Arjan" <arjan@.synion.nl> wrote in message
news:1134310904.001437.37200@.g47g2000cwa.googlegroups.com...
> Yes that did the trick! Thank you!
> I want to alter a 'template' rdlc with new values and stream the result
> to the reportviewer control. That is why I used the stream.
> Does anyone know an opensource project 'rdl(c) file to class'? Input is
> the path to an rdl(c) file, output is a class with all the settings in
> the file. Simply alter class and stream class.ToSring() to the viewer.
> Thank you,
> Arjan
>

Monday, February 20, 2012

LoadSnapshot: Item with session: ...

I have a application that uses the Report Viewer control. I ran across a
strange error executing a report.
What does this error message mean and how do you fix it?
w3wp!session!5!04/13/2007-22:38:55:: i INFO: LoadSnapshot: Item with
session: yzyevt45bsjnhi55g1tpso45, reportPath: , userName: MY_NET_1\DB not
found in the database
w3wp!library!5!04/13/2007-22:38:55:: e ERROR: Throwing
Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException:
Execution 'yzyevt45bsjnhi55g1tpso45' cannot be found, ;
Info:
Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException:
Execution 'yzyevt45bsjnhi55g1tpso45' cannot be foundHello Parker,
I would like to know this issue more detailed.
1. Did you use the ReportingViewer to connect to the Server report?
2. Have you applied the latest services pack 2 on the report server?
3. If you restart the IIS in the report server, did this issue still
occured?
4. What's the Application pool identity you use of the Application pool for
Reporting Services? If you change it to the Domain admin, did this issue
still occur?
Please let me know the result and so that I can provide further assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Sorry I haven't had a chance to get back sooner.
1. Yes I did use the ReportViewer to connect to the Server report.
2. No, SP2 has not been applied. We are scheduling this for the weekend.
3. This only happened once so far. But there is not normal production use
yet.
4. We will change pool identity Domain admin this weekend.
So for now, we will make the changes and wait to see if it occurs again.
Thanks for the help.
"Wei Lu [MSFT]" wrote:
> Hello Parker,
> I would like to know this issue more detailed.
> 1. Did you use the ReportingViewer to connect to the Server report?
> 2. Have you applied the latest services pack 2 on the report server?
> 3. If you restart the IIS in the report server, did this issue still
> occured?
> 4. What's the Application pool identity you use of the Application pool for
> Reporting Services? If you change it to the Domain admin, did this issue
> still occur?
> Please let me know the result and so that I can provide further assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Wei Lu,
I am seeing this same behavior in a completely different environment.
1) application that uses the Report Viewer connect to the Server report.
2) SP2 is applied
3) I restarted IIS on the RS server, but it did not correct the issue. I
also restarted the RS server, but the issue continues.
4) I don't currently have the capability to adjust the Application pool
identity, but am trying to get that changed now.
Do you have any further information on what might be causing this error?
thanks.
"Wei Lu [MSFT]" wrote:
> Hi ,
> How is everything going? Please feel free to let me know if you need any
> assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Wei Lu --
I too am experiencing the Execution 'xxx' cannot be found error. I am
using ReportViewer, with SP2 is installed. This is a local RS install
using the Network account on XP SP2.
The problem is very intermittent -- occurred 3 times today. Twice when
setting report parameters and clicking 'View Report', another when
clicking the double-arrows to show/hide the parameter area. There was
no length of inactivity (some users reported problems after 10 minutes
of inactivity -- I think this is a different issue).
Any help would be appreciated!
Thanks,
Chris