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. Web Development
  3. ASP.NET
  4. hiding columns in a report viewer

hiding columns in a report viewer

Scheduled Pinned Locked Moved ASP.NET
questioncsharptutorial
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.
  • K Offline
    K Offline
    keroed_edmond
    wrote on last edited by
    #1

    i am building a report.rdlc and using the report viewer and i wanted to know how can i hide or unhide columns in my report is this possible? can anyone assist me? oh p.s. using c# but it doesn't matter if u know how to do it in vb will jus convert it kenny

    S V 2 Replies Last reply
    0
    • K keroed_edmond

      i am building a report.rdlc and using the report viewer and i wanted to know how can i hide or unhide columns in my report is this possible? can anyone assist me? oh p.s. using c# but it doesn't matter if u know how to do it in vb will jus convert it kenny

      S Offline
      S Offline
      sPaudel
      wrote on last edited by
      #2

      oh.. I have faced the same problem too. But i convert the report to excel and do the work what i required to fulfill only my output. If u get the some solution please share it

      K 2 Replies Last reply
      0
      • S sPaudel

        oh.. I have faced the same problem too. But i convert the report to excel and do the work what i required to fulfill only my output. If u get the some solution please share it

        K Offline
        K Offline
        keroed_edmond
        wrote on last edited by
        #3

        yes i found a solution what u do is this step 1 create a dataset with a table that has all the possible columns that you might use in your report step 2 add all of these columns to your report step 3 create report parameters for all the columns u want to hide / un-hide step 4 assign the value of the hidden property for each column to evaluate whether or not to set hidden property to true or false example set hidden property to =iif(Parameters!param_TicketId.Value="T",True,False) step 5 assign values to the report parameters wherever you are going to build and run the report ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report.rdlc"); ReportDataSource rds = new ReportDataSource(); rds.Name = "spTroubleTicket_AllTableAdapter"; rds.Value = dsReport.Tables[0]; ReportViewer1.LocalReport.DataSources.Add(rds); ReportParameter[] param = new ReportParameter[2]; param[0] = new ReportParameter("param_TicketId", "F"); param[1] = new ReportParameter("param_TimeRecieved", "T"); ReportViewer1.LocalReport.SetParameters(param); ReportViewer1.LocalReport.Refresh(); you can do any manipulation you want based on the code above my original code i allowed my users to select the column the wanted to be in the report. and i also allowed them to generate the dataset based on the specific search criteria they chose to use and use this as the dataset. so in essence i create a data table with all possible columns and added it to my report and then allowed user to hide and unhide columns and generate there dataset to be used on the report dynamically Kenny Edmond

        1 Reply Last reply
        0
        • S sPaudel

          oh.. I have faced the same problem too. But i convert the report to excel and do the work what i required to fulfill only my output. If u get the some solution please share it

          K Offline
          K Offline
          keroed_edmond
          wrote on last edited by
          #4

          p.s if u have any other problem just drop a message here will reply as soon as i see it

          1 Reply Last reply
          0
          • K keroed_edmond

            i am building a report.rdlc and using the report viewer and i wanted to know how can i hide or unhide columns in my report is this possible? can anyone assist me? oh p.s. using c# but it doesn't matter if u know how to do it in vb will jus convert it kenny

            V Offline
            V Offline
            Vlad Bezden
            wrote on last edited by
            #5

            Left mouse click on the column (make sure you are not clicking on header or data cell, you have to click on the column itself (above the header)) that you would like to enable/hide and right mouse click and click on Properties (or hit F4). You will see TableColumn properties. You will have there Visibility property with + sign on the left. Click on + sign and expand Visibility. You will have there Hidden property. You can put your custom code to to view or hide your column. For instance =IIF(Fields!LeadNext.Value = 4, TRUE, FALSE).

            Vlad Bezden

            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