Crystal Reports putting a group in different columns

故事扮演 提交于 2020-01-14 05:41:08

问题


I'm trying to take one group and put it in two different columns. I know you can do that for the details of a group in the section expert but it won't allow you do so for a group. The group is date that I've separated by months for the all of last year and this year to the current date and I want last year's months in one column and this year's months in another column. Like this:

    January 2011             January 2012
    February 2011            February 2012
    March 2011               March 2012
    April 2011               April 2012
    May 2011
    June 2011
    July 2011
    August 2011
    September 2011
    October 2011
    November 2011
    December 2011

That way the months are easy to compare and they can be drilled down. Any ideas?


回答1:


  1. In Details section's 'Section Expert', select 'Format with Multiple Columns'
  2. Select the (now visible) Layout tab
  3. Select 'Format Groups with multiple column'
  4. Add a second group on your date field by year (make sure it is 'outside' the mm/yyyy grouping)
  5. Size the footer of the section you created in #4 to get each year to be in its own column



回答2:


If you group by month name (like monthname({transaction.date}) so January 2011 and 2012 will be in the same group) then you can use a running total to summarize the years individually within that group. You can do this by creating two running total fields, one with an evaluate formula like year({transaction.date})=2010 and another with the formula year({transaction.date})=2011.

Note that running totals won't work in the group header though, so you'd need to migrate those fields down into the group footer instead.




回答3:


How about using a cross-tab like:

           2011    2012
January      10      12
February      5      12
March         8       1

This would be a lot more flexible.



来源:https://stackoverflow.com/questions/9997617/crystal-reports-putting-a-group-in-different-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!