COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: dxwallace on 06 Jun 2007 11:06:38 AM

Title: Concatenate a string onto column headers
Post by: dxwallace on 06 Jun 2007 11:06:38 AM
I thought this was a simple issue but it's not, can someoen please help!!

I am trying to add a string into the column headers for multiple items of a report. Since string will be for many columns, and I am trying to create a field instead of just hardcoding the string (which is 'SPD") to to the end of the column header. The column header is a [Query1].[Month].  I want to create another data item called [Query1].[ColHeader] which I set to the value of ' SPD' in the expression editor. However when I to use a column header defined as [Query1].[Month] + [Query1].[ColHeader] I get an error saying that the second part is an invalid expression.

Can someone tell me why?
Title: Re: Concatenate a string onto column headers
Post by: ajax6262 on 06 Jun 2007 11:40:09 AM
Create your data item, but make sure that the expression is ' SPD' (including the space).  Then unlock the column header cells, and drag the spd data item into the header cell next to the default header.
Title: Re: Concatenate a string onto column headers
Post by: dxwallace on 06 Jun 2007 03:22:21 PM
How do you unlock the column header cells?
Title: Re: Concatenate a string onto column headers
Post by: dxwallace on 06 Jun 2007 03:25:55 PM
Nevermind that last question, I saw that there was a lock icon on the toolbar and that did the trick.

Thanks
Title: Re: Concatenate a string onto column headers
Post by: dxwallace on 06 Jun 2007 03:48:41 PM
However, when I unlock the report and drag the String field in, there is nothing showing on the report. Can you tell me why that is?
Title: Re: Concatenate a string onto column headers
Post by: dxwallace on 06 Jun 2007 04:10:41 PM
I changed the "Source Type" attribute in the properties pane to "report expression" from "data item value" (since that was the same attribute that I am trying to concatenate to) and now I can see the " SPD" in the column header.

If someone can tell me why I did what I did works, that would be cool