Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Report viewer control problem in Windows forms

Report viewer control problem in Windows forms

Scheduled Pinned Locked Moved Windows Forms
csharpwinformshelpdotnet
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shashikanthtalupuru
    wrote on last edited by
    #1

    Hi friends I am developing my project in .net framework2.0 and c#.I am using microsoft reporting services and created an rdlc file.I am using reportviewer control to load and display the report. But I am not able to get the report and i am not getting any error. Below is my code. private void BindCustomersreport() { ds = new DataSet(); RBLL = new ReportBLL(); ds = RBLL.ShowCustomersReport(RBLL); if (ds.Tables[0].Rows.Count != 0) { reportViewer1.Visible = true; reportViewer1.ProcessingMode=Microsoft.Reporting.WinForms.ProcessingMode.Local; reportViewer1.LocalReport.ReportEmbeddedResource = @"C:\Inetpub\wwwroot\Tirumala Gruha Nirman\Tirumala Gruha Nirman\CustomersContactList.rdlc"; reportViewer1.LocalReport.DataSources.Clear(); bindingSource1.DataSource = ds.Tables[0].DefaultView; rpt.Name = "Customerscontactinfo_sp_showcontactlistofcustomers"; reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("Customerscontactinfo_sp_showcontactlistofcustomers",bindingSource1)); // reportViewer1.LocalReport.DataSources.Add(rpt); reportViewer1.DocumentMapCollapsed = true; reportViewer1.LocalReport.Refresh(); } else { reportViewer1.Visible = false; } } Please suggest me my mistake... With Regards Shashi.

    H E 2 Replies Last reply
    0
    • S shashikanthtalupuru

      Hi friends I am developing my project in .net framework2.0 and c#.I am using microsoft reporting services and created an rdlc file.I am using reportviewer control to load and display the report. But I am not able to get the report and i am not getting any error. Below is my code. private void BindCustomersreport() { ds = new DataSet(); RBLL = new ReportBLL(); ds = RBLL.ShowCustomersReport(RBLL); if (ds.Tables[0].Rows.Count != 0) { reportViewer1.Visible = true; reportViewer1.ProcessingMode=Microsoft.Reporting.WinForms.ProcessingMode.Local; reportViewer1.LocalReport.ReportEmbeddedResource = @"C:\Inetpub\wwwroot\Tirumala Gruha Nirman\Tirumala Gruha Nirman\CustomersContactList.rdlc"; reportViewer1.LocalReport.DataSources.Clear(); bindingSource1.DataSource = ds.Tables[0].DefaultView; rpt.Name = "Customerscontactinfo_sp_showcontactlistofcustomers"; reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("Customerscontactinfo_sp_showcontactlistofcustomers",bindingSource1)); // reportViewer1.LocalReport.DataSources.Add(rpt); reportViewer1.DocumentMapCollapsed = true; reportViewer1.LocalReport.Refresh(); } else { reportViewer1.Visible = false; } } Please suggest me my mistake... With Regards Shashi.

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      Have you stepped through your code to see if your if condition is false, therefore running your reportViewer1.Visible = false; line? In other words, does ds.Tables[0].Rows.Count == 0?

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      S 1 Reply Last reply
      0
      • H Henry Minute

        Have you stepped through your code to see if your if condition is false, therefore running your reportViewer1.Visible = false; line? In other words, does ds.Tables[0].Rows.Count == 0?

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        S Offline
        S Offline
        shashikanthtalupuru
        wrote on last edited by
        #3

        Hi Henry I am getting data as ds.Tables[0].rows.count!=0 and reportviewer1 is also set to true.I am able to see the report control but not the data in the win form. I hope data is not binding to the report or report is not loading..

        H 1 Reply Last reply
        0
        • S shashikanthtalupuru

          Hi Henry I am getting data as ds.Tables[0].rows.count!=0 and reportviewer1 is also set to true.I am able to see the report control but not the data in the win form. I hope data is not binding to the report or report is not loading..

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          In that case, I'm stumped. Sorry! :(

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          1 Reply Last reply
          0
          • S shashikanthtalupuru

            Hi friends I am developing my project in .net framework2.0 and c#.I am using microsoft reporting services and created an rdlc file.I am using reportviewer control to load and display the report. But I am not able to get the report and i am not getting any error. Below is my code. private void BindCustomersreport() { ds = new DataSet(); RBLL = new ReportBLL(); ds = RBLL.ShowCustomersReport(RBLL); if (ds.Tables[0].Rows.Count != 0) { reportViewer1.Visible = true; reportViewer1.ProcessingMode=Microsoft.Reporting.WinForms.ProcessingMode.Local; reportViewer1.LocalReport.ReportEmbeddedResource = @"C:\Inetpub\wwwroot\Tirumala Gruha Nirman\Tirumala Gruha Nirman\CustomersContactList.rdlc"; reportViewer1.LocalReport.DataSources.Clear(); bindingSource1.DataSource = ds.Tables[0].DefaultView; rpt.Name = "Customerscontactinfo_sp_showcontactlistofcustomers"; reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("Customerscontactinfo_sp_showcontactlistofcustomers",bindingSource1)); // reportViewer1.LocalReport.DataSources.Add(rpt); reportViewer1.DocumentMapCollapsed = true; reportViewer1.LocalReport.Refresh(); } else { reportViewer1.Visible = false; } } Please suggest me my mistake... With Regards Shashi.

            E Offline
            E Offline
            Elizabeth Connolly
            wrote on last edited by
            #5

            Hi, Along the lines of what Henry suggested, is there data in ds.Tables[0].DefaultView (You said there are rows in the dataset, but how about the default view?) Also, looking at what I've done when using the report viewer, I've also set the LocalReport.ReportPath to the path of the .rdlc file, as well as using the ReportEmbeddedResource. I'm not sure it's necessary, but maybe you can try it

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups