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. Dynamic column in SSRS 2005

Dynamic column in SSRS 2005

Scheduled Pinned Locked Moved ASP.NET
sql-serverquestion
7 Posts 2 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.
  • P Offline
    P Offline
    Pankaj Saha
    wrote on last edited by
    #1

    I have to create a report, where I have to show the columns dynamically according to the parameters. i.e. I have a date selection criteria may 2008 to june 2008 or june 2009. Now the report will be shown by the month of different locations. Here numbers of month are changing according to the selected date. I have used matrix, could not change the column dynamically. Is there any method to achieve this?:confused:

    Pankaj

    N 1 Reply Last reply
    0
    • P Pankaj Saha

      I have to create a report, where I have to show the columns dynamically according to the parameters. i.e. I have a date selection criteria may 2008 to june 2008 or june 2009. Now the report will be shown by the month of different locations. Here numbers of month are changing according to the selected date. I have used matrix, could not change the column dynamically. Is there any method to achieve this?:confused:

      Pankaj

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      In the report designer you should be able to right-click on the column and select Column Visibility. From there set an expression to hide or show the column as necessary


      only two letters away from being an asset

      P 1 Reply Last reply
      0
      • N Not Active

        In the report designer you should be able to right-click on the column and select Column Visibility. From there set an expression to hide or show the column as necessary


        only two letters away from being an asset

        P Offline
        P Offline
        Pankaj Saha
        wrote on last edited by
        #3

        Thanks for the replay. But the columns are generated dynamically, so we do not know how many column and what column will be shown.

        Pankaj

        N 1 Reply Last reply
        0
        • P Pankaj Saha

          Thanks for the replay. But the columns are generated dynamically, so we do not know how many column and what column will be shown.

          Pankaj

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Your statement make no sense at all.

          Pankaj Saha wrote:

          what column will be shown.

          Then how can you determine when to show or hide in the first place.

          Pankaj Saha wrote:

          columns are generated dynamically

          Are you generating the RDL for the report? Then you control the columns anyway.


          only two letters away from being an asset

          P 1 Reply Last reply
          0
          • N Not Active

            Your statement make no sense at all.

            Pankaj Saha wrote:

            what column will be shown.

            Then how can you determine when to show or hide in the first place.

            Pankaj Saha wrote:

            columns are generated dynamically

            Are you generating the RDL for the report? Then you control the columns anyway.


            only two letters away from being an asset

            P Offline
            P Offline
            Pankaj Saha
            wrote on last edited by
            #5

            Mark Nischalke wrote:

            what column will be shown.

            There are 12 months in the column, but when I select a date range i.e. March, April and December of 2009 then there would be only 3 month columns. So its depends on the selected date range. Months column can be increased/decrease according to the selected date range. Since I have to show in the matrxi form because I am also selecting the location/country with date range then it will show the records by location and by selected date. I have used Sql Server procecdure where I have to pass the date range and location information then it shows the result in the following manner State January March April A 20 30 40 B 5 6 30 Hera state rows and columns are generated dynamically. This the report in SSRS 2005. I did not get any solution to show this type of records where columns are generated dynamically.

            Pankaj

            N 1 Reply Last reply
            0
            • P Pankaj Saha

              Mark Nischalke wrote:

              what column will be shown.

              There are 12 months in the column, but when I select a date range i.e. March, April and December of 2009 then there would be only 3 month columns. So its depends on the selected date range. Months column can be increased/decrease according to the selected date range. Since I have to show in the matrxi form because I am also selecting the location/country with date range then it will show the records by location and by selected date. I have used Sql Server procecdure where I have to pass the date range and location information then it shows the result in the following manner State January March April A 20 30 40 B 5 6 30 Hera state rows and columns are generated dynamically. This the report in SSRS 2005. I did not get any solution to show this type of records where columns are generated dynamically.

              Pankaj

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              So return 0's or nulls for the columns you don't want to show and use an expression to hide/show the columns. State January Febuary March April May June July A 20 0 30 40 0 0 0 B 5 0 6 30 0 0 0 It seems like you're making this more difficult than it is


              only two letters away from being an asset

              P 1 Reply Last reply
              0
              • N Not Active

                So return 0's or nulls for the columns you don't want to show and use an expression to hide/show the columns. State January Febuary March April May June July A 20 0 30 40 0 0 0 B 5 0 6 30 0 0 0 It seems like you're making this more difficult than it is


                only two letters away from being an asset

                P Offline
                P Offline
                Pankaj Saha
                wrote on last edited by
                #7

                I got a solution by which I can hide the column in the column expression. i.e. I have selected Jul column Select Column -> Propeties -> Visibility -> Select Expression radio button and type the following expression =iif(Fields!Jul.IsMissing,true,false) However this is not the perfect solution. If I fetch records which contains Jun, Jul, Aug and write the above expression to hide the jul column then the Jul column will be hide but there would be space between the Jun and Aug. I want the space should not be there if the column does not hide. I am getting the following formate before hide State Jun Jul Aug A 10 12 12 B 12 14 15 After hiding State Jun <--space--> Aug A 10 <--space--> 12 B 12 <--space--> 15

                Pankaj

                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