Jump to content
Changes to the Jaspersoft community edition download ×

Multiple column heading


2004 IR Help

Recommended Posts

By: Kundan Lal - lalkundan

Multiple column heading

2004-05-14 00:28

Hi,

 

I like to generate year wise report, which has following query

 

SELECT Country, SOURCETYPE, YEAR,sum(Sal) Total_Spend

FROM Emp_data_tbl

GROUP BY Country, SOURCETYPE, YEAR

 

I am not able to genrate report heading as

_______________________________

| 2001 | 2002 | 2003 |

--------+---------+-------+-------+

US |

--------+---------+-------+-------+

OGH | 1212100 | 67456 | 12125 |

------------------------------------

 

Please let me know how I can generate heading dynamically and populate the data in the Report.

 

I am able to generate report with single "year" column heading, but not able to do that for multiple year column. :-?

 

Thanks.

 

 

 

 

 

By: Alin Vaida - alinv

RE: Multiple column heading

2004-05-14 05:11

You can do this by using 2 multi-column (using horizontal layout) subreports.

 

HTH,

Alin

 

 

 

 

By: Kundan Lal - lalkundan

Found one solution

2004-05-21 03:03

Thanks Alin,

 

I have used Decode for creating a query of my requirement.. but I will check with sub reports.

 

SELECT Country, SOURCETYPE, sum(Sal) Total_Spend,

sum(DECODE(YEAR,'2002',,0)) "2002",

sum(DECODE(YEAR,'2003',,0)) "2003"

FROM Emp_data_tbl

GROUP BY Country, SOURCETYPE, YEAR

 

 

 

 

 

 

 

 

By: Alin Vaida - alinv

RE: Found one solution

2004-05-21 03:48

This works fine as long as you know exactly how many columns (in this case, years) you have. You can even make the header static for this one.

Otherwise, you'll have to use subreports.

 

 

 

 

By: Kundan Lal - lalkundan

RE: Multiple column heading

2004-05-25 23:03

I am now trying with subreport but not able to generate a single row consisting all "year" values of following query.

 

SELECT distinct YEAR

FROM Emp_data_tbl;

 

please let me now if you have any soluntion to the problem, may be using subreports.

 

Thanks

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...