Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type of data problem 2

Status
Not open for further replies.

julen

Programmer
Mar 26, 2006
27
ES
Hi friends,

I have a problem. I want to know if it is possible
to have a type of data in db2 that can stored something
like that:



Hello (write in black) world (write in italic (cursive))


I mean, store a rich text.

Thanks.


 
Hi Julen,
DB2 just stores data. If you wish to present it in a particular way, this should be done with a display package (like Crystal Reports for instance) or a programming language that can manipulate the printer via printer control characters.

It's possible I guess to have a field that contains the data, followed by another field that contains the display attribute, and use a programming language to format the print in this fashion, but there are much easier ways to do it, in my opinion.

Hope this helps.

Marc
 
Hi again,

Can you explain me please, how can i do it using Crystal Reports? I mean, without using the crystal report to rich the text. before show it, how can i store the data
followed by another field that contains the display attribute?

I am working with C# code. (Visual Studio in .NET)

Thanks again
 
Julen,
If using Crystal Reports you would need to obtain the data from within Crystal Reports and then use that tool to format the output, changing the fonts and characterics as required. There are many tools that will enable you to do this (MS Access for instance) but it depends upon what you have available on your platform, and how competent you are with those packages.

If you wanted to go the other way you could store the display attribute and do it programmatically in C#. For this, you would need to find out what printer you are using and what the control characters are for the display attributes you require. You would then need to obtain the data and display attribute in C# and write directly to the printer using the relevant control characters.

This is not something that I would consider doing, as it is an awful lot of trouble when you should have packages available which do this for you.

Marc
 
Hi Marc,

My boss wants to write the text in a .net component, in a text box or something giving the rich text to the words and then store it in the db2 database.
Then, read the information and show it a report without applying any format.


How you can do it? Is it possible??

Thank u very much again!
 
Julen,
I don't know enough about .net but am assuming you're talking about obtaining text and allowing it to be formatted online by the user (bold, italics, line breaks etc).

You then want that text stored in DB2 and when it is written to a report, the same formatting that was applied by the user, is applied to the report.

DB2, as far as I am aware, can't do this. The only thing that springs to mind, is whether .net can capture the formatting control characters, and translate them into something like HTML. You could then store the text as HTML and reformat it for print using something (IE?) that understands HTML.

Sorry to not be of more help.

Can anybody else come up with a more friendly alternative?

Marc
 
Thank u both.

I am going to read the articles.

See you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top