If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Query on text item

Started by Arumugam, 08 Mar 2017 02:09:50 AM

Previous topic - Next topic

Arumugam

Hi Team,

          I have used one text item(source as report expression which gets value from parameter and displays) inside a block and set a size & overflow,font size of text.Now the user wants to display the text as they typed in the text item in the output PDF version(like bold letters,spacing etc).Is that possible?

AnalyticsWithJay

Are you asking if it's possible to have the style of the text to be formatted dynamically?


Arumugam

Yeah right.In the same way they enter in the text box prompt

AnalyticsWithJay

Quote from: Arumugam on 08 Mar 2017 02:09:50 AM
Now the user wants to display the text as they typed in the text item in the output PDF version(like bold letters,spacing etc).Is that possible?

Quote from: Arumugam on 08 Mar 2017 07:17:44 AM
Yeah right.In the same way they enter in the text box prompt

A text box prompt doesn't provide the user any formatting controls. Where are you getting the formatted display in PDF version from?

Could you explain what the user is typing, what they're seeing, and what they're expecting to see? And are you saying the output looks different between PDF and HTML?

Arumugam

#4
My report has "n" number of pages and first one is dashboard page.At the bottom of the dashboard page text box prompt is used (show/hide) when user clicks show button text prompt will be visible and user can enter the text in it and submit it after that text will be added at the end of the page in html.When the report is viewed in PDF ,all the pages will be shown.In HTML only dashboard page will be visible.When user enters the text which included many paragraph,line break but all of them are showing it in one paragraph without any spacing and line breaking

AnalyticsWithJay

I understand now.

char(10) + char(13) will give you a new line (carriage return, line feed) if used in a report expression.

To do what you're looking for you'd have to use replace or substitute() to replace \r\n with char(10)+char(13)... I just don't know if Cognos can recognize the \r\n values.

Arumugam

Could you please explain it brief? Currently I have used like paramdisplayvalue(parametername)..Will I need to use above expression + \r\n

AnalyticsWithJay

Quote from: Arumugam on 08 Mar 2017 10:19:24 AM
Could you please explain it brief? Currently I have used like paramdisplayvalue(parametername)..Will I need to use above expression + \r\n

My point was that I don't think you could do this. In programming languages, you could typically capture Carriage Returns and Line Feeds by looking for \r\n. You could then replace it with the ASCII equivalent of char(13) or char(10).

In Cognos, you're working with a string returned by the application and you don't have the same access to programming languages. You don't have \r\n by the time the string is returned to you, and you don't have a way to look for it.