Report Viewer Fails to reload report?

Hello everyone,

    I have run into a unique problem with the Report Viewer that I can not seem to solve.  Originally I had created a series of WebForms and placed the ReportViewer Control there.  This worked fine and I was able to change report parameters, update the report, etc without a problem.

Well the requirement changed and I had to move the ReportViewer from a webform to a UserControl so that it could function inside the Kentico CMS but I had to make an adjustment and add the ReportViewer control at run time as opposed to design time because the CMS, apparently, tried to access the ClientID of the ReportViewer prior to OnInit.

So I did all of this and got the ReportViewer running, was loading reports, etc.

When the page that hosts my user control first loads I can load any report into the ReportViewer without a problem however, if I try to change the parameters or load a different report the ReportViewer maintains the values from the initial report.    

private SomeMethod() 
{     
      ReportDataSource ds = new ReportDataSource("datasource", );
            ReportParameter[] p = new ReportParameter[2];
            p.SetValue(new Microsoft.Reporting.WebForms.ReportParameter("low", ), 0);
            p.SetValue(new Microsoft.Reporting.WebForms.ReportParameter("high", ), 1);
            pnlReport.Controls.Add(ReportingUtilities.GenerateReportControlWithDataSet(ds, @"Report.rdlc", p));
}
    public static ReportViewer GenerateReportControlWithDataSet(ReportDataSource ds, string ReportPath, ReportParameter[] parameters)
    {
        ReportViewer report = new ReportViewer();
        report.Reset();
        report.ProcessingMode = ProcessingMode.Local;
        report.LocalReport.DataSources.Clear();
        report.ID = "Report";
        report.Width = Unit.Pixel(700);
        report.Height = Unit.Pixel(400);
        report.LocalReport.ReportPath = ReportPath;
        report.LocalReport.DataSources.Add(ds);
        report.LocalReport.Refresh();
        
        if (parameters != null) report.LocalReport.SetParameters(parameters);
        report.DocumentMapCollapsed = true;
        return report;
    }

 

I have gone so far as to do pnlReport.Controls.Clear() which has no effect.

Does anyone have any thoughts or ideas?


===========================================================
Hope that helped.
-Doug

If this post solved your problem please mark it as being the answer so that we all
know you have been helped!
0
dparsons
1/10/2008 10:21:22 PM
asp.net.ssrs 4514 articles. 1 followers. Follow

2 Replies
1308 Views

Similar Articles

[PageSpeed] 33
Get it on Google Play
Get it on Apple App Store

Truly I hate hacks to get things to work but after giving Google one hell of a beating I still could not come up with the "correct" way to resolve this problem ultimately I settled on this hack:

  

<asp:Panel ID="pnlReport" runat="server" />
<asp:Panel ID="pnlReportAlt" runat="server" Visible="False" />
  
private Panel TogglePanels()
{
   if(pnlReport.Visible)
   {
       pnlReport.Visible = false;
       pnlReportAlt.Visible = true;
       return pnlReportAlt;
   }
   else
   {
       pnlReport.Visible = true;
       pnlReportAlt.Visible = false;
       return pnlReport;
   }
}
  
TogglePanels().Controls.Add(ReportingUtilities.GenerateReportControlWithDataSet(ds, @"Report.rdlc", p));

 


===========================================================
Hope that helped.
-Doug

If this post solved your problem please mark it as being the answer so that we all
know you have been helped!
0
dparsons
1/12/2008 3:49:18 AM

I developed a report in ASP.net and used chart control to display bar diagrams based on the result of storedprocedure. I binded this report to the reportviewer control dynamically. But if there is only one or two rows the single bar occupies the complete report. however, I want in a such way where if there is only one bar to display then it should display and the others should only display the y-axis titles with no bars. But in my case only one y-axis title with one bar occupies entire report. Here is the data:

A B C App   ---- Column names

1 0 0 App1  ----- data

for the above data the entire report has only App1 that is the bar width and the report width coming same. Is there any possiblity of resizing the bars based on data....

 

 

 

0
kanthu2681
8/9/2008 5:19:22 PM
Reply:

Similar Artilces:

"Load Report Failed."
Hi Everyone, I have developed a report in VS2005 (On a Vista PC, in case that's relevant). In the report designer, I switch to "Main Report Preview" and the report shows up fine - it get the data from the database and displays perfectly. I tried to add a page to display the report in my app.  I added a crystal report viewer and a Crystal Report Source.  The report displays fine in design view.  However, when I run the app, all I get is "Load Report Failed". Please see the code below:<%@ Page Language="C#" M...

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

Report Control (report viewer and report designer)
Hi there! ive looked over the forums and other websites that you referred but i dont have any luck for reports. i created a page that has simple data-entry, aside from that, i do want to have a printable report on what are the items i have added this day. i am using a report designer (rdlc) and a report viewer, which is in a aspx page. ive explored how it works for a simple select statement but i want to know how it will work for parameter passing. a referral for a tutorial website for the report viewer and report designer is very much appreciated. or if you want to share your...

How can I cahnge the report header before i load the report into the report viewer?
That is basically it... Thanx in advance What are you trying to change? The report title, the items in the header, etc... Basically, in CR.NET you can't add new objects to the report during runtime. However, you can modify existing objects by setting a reference to them and then changing the properties. I have ample source code in my free ebook that teaches you how to modify the different properties of each report object. www.CrystalReportsBook.com?cpgn=asp.net HTH, Brian Bischof Brian Bischof www.CrystalReportsBook.com ...

display reporting services report in report viewer in remote mode
Hi  I have some problem in displaying a report done through reporting services in asp.net 2.0 report viewer server control for remote processing mode.I have created a Reporting Services project through Business Intelligence Development Studio and another Web application project in VS 2005. I have take a Report Viewer control on a form to view report created in the reporting services project. I have set the Processing mode of Report Viewer to Remote, have set ReportServerURL to "http://localhost/ReportServer" and Report Path as the "/(Reporting service proje...

integration of Crystal Report with .NET ; crystal report viewer not displaying in Toolbox
Hi I m new to Visual Web Developer 2005 Express Edition. I want to integrate Crystal Report with .NET. In my Toolbox , Crystal Report Viewer is not displaying. How to make it possible? + How to call my report from asp.net 2.0. Need source code plz.*Share Knowledge Every TIME Crystal Reports for .NET does not come with VWD Express.  It only comes with VS 2005 Professional (I'm not sure about the Standard edition).If you have Crystal Reports 10 or XI, you can installed the .NET libraries for Crystal and then use them within VWD Express, noting that you have to build your reports ...

Call SSRS 2005 Report from VB.NET and save report to directory after ran
I'm not sure quite where to post this but: How can I call an SSRS 2005 Report from my VB.NET application and have the report saved to a specific folder. I need to create a summary report every time my VB.NET code runs. I just don't know how to achieve this in VB.NET and SSRS 2005. Example: 1) My VB.NET console application runs 2) the console app splits out a txt file and inserts its rows into several DB tables 3) I want to somehow call a report I create in SSRS , let's call it "Summary Report" and have it run based on the results of this run into a PDF or something into the directory I ...

.Net 2.0, Dataset Datasource Report, LoadSaveReportException: Load report failed.
I recently migrated our 1.1 web app. to 2.0 and VS2005. After migrating the application all of my related Crystal reports were failing. I found that during the migration to VS2005 my crystal references were changed from version 9.2.xx to 10.xx, or the version packaged with VS2005. I deleted the 10.xx references and reinstated my 9.2.xx references. Most of my reports are now working. However, all of my reports that are created using the Push method via dynamically loaded datasets fail to even load. I get the LoadSaveReportException:Load report failed.  Has anyone else ran into this pro...

report viewer with crystal reports
Hi every one ....i am a starter in integrating crystal reports to the asp .net website using report viewer.. it would be helpful if some one could point me on where to get started with some tutorials of 1. posting the crystal reports to the server 2. displaying the crystal reports in asp .net reportviewer control on a aspx page Thanks in advanceSriPlease mark as answer if it helped you Go to http://www.crystalreportsbook.com/, and http://aspalliance.com/crystal/.  If my post is your answer, please mark it as the answer. It will bring good karma.Crystal AllianceMy Blog...

Report viewer not showing report
Hi all. I have a Report Viewer control on my page which isnt displaying the specified report. When the page renders it doesnt error, all i can see is a tiny wee scroll bar at the rigth-hand side of the page. On my aspx page the code is as follows: "ReportViewer2" runat="server" Width="100%" Height="1000px" Visible="false">  And on the code behind i have the following code: private void LoadReport() { string ReportName = cboReportNames.SelectedValue.ToString(); if (ReportName == "&lt;S...

Report Viewer / Report Path
Hello, i have a problem with an aplication. I have a ReportingServices project in wich i have some reports. Then i have a website in wich i want to see the reports that i have. I use a Report viewer to see the reports. The parameters that each report have i built inside the webpage that i have. For this reason i set the showparamateters property to false inside the report viewer. i make all the functionality in order to show the report inside the page and it works fine. I navigate inside the report viewer and go to another link report inside the first report that i show, but the when I wante...

Report Viewer And Report Document
Hi Folks What is the difference between Report Viewer And Report Document ? In Which Condition we have to use where Report VIewer or Report Document Thanking you rajaThanks,Regards,Rajamsrasa@yahoo.com The report viewer is a quck way to load and display a crystal report. A report document is a more full featured object model, which allows you to change more options. It takes more work to use a report document, but gives you more control. For better description, buy the book from www.crystalreportsbook.comIf my post is your answer, please mark it as the answer....

Facing Failed to load viewstate problem while loading data into Report Viewer control from Report Server.
Hi All, I have an ASP.NET 2.0 web application. In that we are using ReportViewer control to show the data from the report Server. Based on item selection we are loading the data to the Same ReportViewer control . We are using the below code.string reportserverUrl = MetadataHelper.GetModuleMetaDataValue(8, reportId, "ReportServerURL");   reportViewer.ServerReport.ReportServerUrl = new Uri(reportserverUrl); reportViewer.ServerReport.ReportPath = "Reportpath"  Whenever I clicks repeatedly on reportitems for reports data , I am getting the following err...

Report "Load report failed" while report using data field
hi all, I'm develop asp.net and crystal report from visual studio 2003 environment. all the completed program & report will place in 1 folder running by IIS5, currently the problem is: if the report is without using database fields is runnable and display well in my page; but if the report need to uses of database's field (no matter from xml or dataset), the page always throw error message "Load report failed", the stack trace always stop in the code "rpt.SetDataSource(ds)" or " rpt.Database.Tables(0).SetDataSource(ds.Tables("tbl1")" or "rpt.ExportToStream (CrystalDecisions.Shared.E...

Web resources about - Report Viewer Fails to reload report? - asp.net.ssrs

Latest Marketing, Tech, Social Media, and Blog Marketing Finds - The Friday Traffic Report
The Friday Traffic Report Home Blog Subscribe! About Jack and Jim Website Promotion Social, Tech, Marketing News Subscribe Now Latest Marketing, ...

Mile High Report - For Denver Broncos Fans
MileHighReport(MHR) is the ultimate independent resource for the Denver Broncos on the web. Along with MHR Radio, the official podcast of MHR, ...

the rajam report
… I kept having trouble with understanding what “mode” I was in, for lack of a better term. Specifically, it was weird that “glances” could only ...

Rasmussen Reports™: The Most Comprehensive Public Opinion Data Anywhere
Rasmussen Reports - The best place to look for polls that are spot on

Insider Trading Report - Institutional Ownership & Insider Trades
Crude Futures Break Below $60, Supply Glut, Weak Demand... Asia Continues to Rally, India Shines, China...

U.S. News & World Report - Wikipedia, the free encyclopedia
U.S. News & World Report is an American news magazine published from Washington, D.C. Along with Time and Newsweek it was for many years a leading ...

Missing surfers: Families of Australians Adam Coleman, Dean Lucas head to Mexico amid reports unidentified ...
... with two identified bodies inside. The families of two West Australian surfers missing in Mexico hold grave fears for their safety, amid reports ...

Report: Mobile Visits to Retailer Websites on the Rise
... new shopping data related to the holiday shopping season, and specifically Black Friday. Rather than Black Friday being a single day, the report ...

Report: VW execs knew about fuel economy, emissions cheating a year ago
... the company's emissions and fuel economy cheating a full year before they became public knowledge, the German newspaper Bild am Sonntag reports. ...

Tyson Fury Vows to Vacate over David Haye; Wladimir Klitschko Eyes Rematch - Bleacher Report
New heavyweight world champion Tyson Fury has revealed he will not fight compatriot David Haye even if it means vacating his belts to prevent ...

Resources last updated: 11/30/2015 10:06:04 PM