posts - 84, comments - 54, trackbacks - 0, articles - 0
             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          How to conditionally hide rows in Cognos report?

          Posted on 2007-08-07 17:23 馬達+斯加 閱讀(491) 評論(0)  編輯  收藏 所屬分類: Java Report


          Data

          Estate

          Block

          Customer

          Status

          ALC

          1

          AAA

           

          ALC

          1

          BBB

          Settle

          ALC

          1

          CCC

           

          ALC

          2

          DDD

          Settle

          ALC

          2

          EEE

           

          RequirementCount records by estate, block, hide customer with status = ‘Settle’ when display.

          Estate

          Block

          Customer

          Status

          ALC

          1

          AAA

           

          ALC

          1

          CCC

           

          Settled case:

          1

           

           

          Total case:

          3

           

           

          ALC

          2

          EEE

           

          Settled case:

          1

           

           

          Total case:

          2

           

           

           

          It is a piece of cake that implementing this report in Crystal report, but it spent me much time in Cognos ReportNet—I can’t find out how to hide a whole row.

          At first, I have tried to control visibility of the fields with conditional variable. But, there still existed a blank row though all the fields were hidden.

          Estate

          Block

          Customer

          Status

          ALC

          1

          AAA

           

          ALC

          1

          CCC

           

           

           

           

           

          Settled case:

          1

           

           

          Total case:

          3

           

           

          ALC

          2

          EEE

           

           

           

           

           

          Settled case:

          1

           

           

          Total case:

          2

           

           

          Another way I have tried is wrapping all fields with conditional block. The blank rows were still there, just with smaller height.

           

          Finally, I gave up finding out which option could be used to hide the whole row. I have amended the SQL with COUNT(…) OVER (PARTITION BY …):

          SELECT estate, block, customer, status, count(customer) over (partition by estate, block) as totalCase FROM table ORDER BY estate, block.

          The retrieved data with the amended SQL:

          Estate

          Block

          Customer

          Status

          totalCase

          ALC

          1

          AAA

           

          3

          ALC

          1

          BBB

          Settle

          3

          ALC

          1

          CCC

           

          3

          ALC

          2

          DDD

          Settle

          2

          ALC

          2

          EEE

           

          2

          In the last step, A filter was added to the details in the report: status <> ‘Settle’, and the calculation of grouping area ‘Total Case’ was set to Average.

           

          主站蜘蛛池模板: 凤冈县| 宝坻区| 岚皋县| 南安市| 锡林浩特市| 淄博市| 宝丰县| 常德市| 同仁县| 集安市| 高唐县| 佛冈县| 福贡县| 陇川县| 武功县| 犍为县| 自贡市| 湛江市| 衡东县| 松阳县| 突泉县| 桐庐县| 城市| 桑日县| 宁海县| 邢台县| 通州区| 阿荣旗| 宣武区| 和平县| 德兴市| 巨鹿县| 江油市| 阜新市| 雅安市| 礼泉县| 八宿县| 和政县| 台北县| 霍山县| 常山县|