none
Report Viewer not returning data RRS feed

  • Question

  • This is an attempt to find a solution to a question posed at this location: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/bce0de19-129e-47a9-84b1-a6ccd6f7727d

    I've converted BIDS 2008 RDL reports to RDLC and embedded them into a VS2010 windows application. The reports run, but do not return data. I also have the webbrowser control that runs the report, but doesn't return data and the date parameter drop down calendar does not work (missing AJAX?). My windows form has a combobox with the reports listed, two radio buttons to select server or local, two datetimepickers and a button to execute the code. The date parameters are visible in the URL, but ignored and the report parameters shows. Here is the button code:

                  try
    
                  {
    
                     setFlash(bServer);
    
                     if (bServer == true)
    
                     {
    
                         if (bHasParams == true)
    
                         {
    
                            sReportParam = "&Start=" + dtpStart.Value.ToShortDateString() + "&End=" + dtpEnd.Value.ToShortDateString();
    
                            sReportUrl = sReportUrl + sReportParam;
    
                         }
    
                         else
    
                         {
    
                            sReportParam = "&Date=" + dtpEnd.Value.ToShortDateString();
    
                            sReportUrl = sReportUrl + sReportParam;
    
                         }
    
                     wbFlash.Navigate(sReportUrl); 
    
                     }
    
                     else
    
                     {
    
                         rpvFlash.Reset();
    
                         rpvFlash.Clear();
    
                         ReportDataSource rds = new ReportDataSource();
    
                         rds.Name = "DataSet1";
    
                         rds.Value = obj;
    
                         this.rpvFlash.ProcessingMode = ProcessingMode.Local;
    
                         this.rpvFlash.LocalReport.ReportEmbeddedResource = sReport; 
    
                         this.rpvFlash.LocalReport.DataSources.Clear();
    
                         this.rpvFlash.LocalReport.DataSources.Add(rds);
    
                         if (bHasParams == true)
    
                         {
    
                          ReportParameter[] rParam = new ReportParameter[2];
    
                          rParam[0] = new ReportParameter("Start", dtpStart.Value.ToShortDateString());
    
                          rParam[1] = new ReportParameter("End", dtpEnd.Value.ToShortDateString());
    
                          this.rpvFlash.LocalReport.SetParameters(rParam);
    
                         }
    
                         else
    
                         {
    
                         ReportParameter rParam = new ReportParameter();
    
                         rParam = new ReportParameter("Date", dtpEnd.Value.ToShortDateString());
    
                         this.rpvFlash.LocalReport.SetParameters(rParam);
    
                         }
    
                         //MessageBox.Show(this.rpvFlash.LocalReport.IsReadyForRendering.ToString()); 
    
                         this.rpvFlash.RefreshReport(); 
    
                     }
    
                  }
    
                  catch (Exception ex)
    
                  {
    
                     MessageBox.Show(ex.Message);
    
                  }   
    
               }
    
           }
    
    
    

    Dan Slaby
    Saturday, November 27, 2010 12:36 PM

Answers

  • I found the missing part, and added a function to fill obj with data before assigning it to rds.value.
    Dan Slaby
    • Marked as answer by dslaby Sunday, November 28, 2010 6:10 AM
    Sunday, November 28, 2010 6:10 AM