Formatting output with colors
Hi,
I want to display a particular word with some color. But I have to choose that word at runtime based on some condition.
for eg: there are 3 words: str1, str2 and str3.
I have to print all the words, but str2 with yellow color and others with normal color ( ie no color ).
How to do this?
Regards,
Kalai
Hi,
Use the FORMAT keyword
eg.
FORMAT color 3.
write str3.
FORMAT color off.
Note :
FORMAT.
Additions:
1. ... COLOR n [ON] or ... COLOR OFF
2. ... INTENSIFIED [ON] or ... INTENSIFIED OFF
3. ... INVERSE [ON] or ... INVERSE OFF
4. ... HOTSPOT [ON] or ... HOTSPOT OFF
5. ... INPUT [ON] or ... INPUT OFF
6. ... RESET
Effect
Sets or modifies the valid output format.
Notes
The formats set by FORMAT are effective from the next output operation to the list, i.e. from the next WRITE command or from the next new line.
The addition ON for switching on the relevant output format is optional.
You can also set the static additions ON, OFF and n (for COLOR) dynamically with = var (for further information, see end of this documentation).
Addition 1
... COLOR n [ON] or ...COLOR OFF
Effect
Color of line background. n can have the following values:
Reward if helpful.
regards,
LIJO JOHN.
Similar Messages
-
Hi, Please help me with the formatting of output XML file using JAXB. This is my client program that marshals xml content into xml file. This program is creating XML file with no indentation at all. I commented out the line
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
still getting same xml file with no indentation. Am I doing anything wrong?
Thanks in advance.
try {
// create a Validator
Validator v = jc.createValidator();
// validate the content tree
boolean valid = v.validate( root );
//logger.info("XML File Validated Successfully" );
Marshaller m = jc.createMarshaller();
m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://mydomain.com/Schemas/data DT.xsd");
DataWriter writer = new DataWriter(
new OutputStreamWriter(new FileOutputStream(fileName),"UTF-8"),
"UTF-8" );
m.setProperty("com.sun.xml.bind.namespacePrefixMapper",new NamespacePrefixMapperImpl());
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(root, writer);
}catch( ValidationException ue ) {
logger.error( "Caught ValidationException"+ue ); throw new SdarsDBException("Validation Exception "+ue);
} catch( JAXBException je ) {
je.printStackTrace();
} catch( IOException ioe ) {
ioe.printStackTrace();Hi,
try writing to the FileOutputStream directly.
I get formatted output this way.
maybe the DataWriter is doinfg some translatiopn for you?
Chris -
I'm currently taking a Java programming class using Java version 1.5.0_06 for my class.
I'm running into problems with the printf statements. Can someone help me figure out what's wrong with this statement?
outFile.printf("%-26s $ %12.2f%n", "Assessed Value:", assessVal);
Basically, I want the output to print, for example:
Assessed Value:********* $ 1000000.00 (* denotes spaces)
This is the error message I get when running it:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method printf(String, Object[]) in the type PrintWriter is not applicable for the arguments (String, String, double)
Any help is appreciated.
ntjavaWell, opened list of arguments which is used by printf method, as well as autoboxing, are 1.5 features. So when you need to compile with an old java (1.4), opened list of arguments is replaced by array of Objects. And in this case you need to write something like
printf("your format string", new Object[] {"some string", new Double(varDouble)});But in this case you need to check what java version do you use to compile it. Just execute
java -versionYou can use -source argument to specify which version of java do you use (1.4 or 1.5) in your java sources. -
How to download the ALV output with colors into the excel sheet
Hi,
I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
can anyone tell how to get the colors in the excel sheet also. thanks...
Regards,
Rose.Hi Camila,
Use the OLE concept.
Check the below threads:
Colors in Excel Sheet
colors in alv
Regards,
Soumya. -
Formatting hyperlinks with color background cells
hello.. i need help figuring out how to fix this error i keep
running into. I have a single cell in a table that i want to have a
background and the cell has numerous hyperlinks. i created the
background color in the single cell just fine, but now all the
hyperlinks have a white background around them. the cell is all
yellow, but the places that have hyperlinks are highlighted in a
white background. how can i fix this? if i remove the hyperlinks
everything looks just fine. if you need me to attach the code, let
me know.Find the link style in your css and remove the background
color.
or you may have defined that color in your body code and it's
overriding the
link background.
Also look for hover, active and visited.
"brittneyf" <[email protected]> wrote in
message
news:f5c2o6$rib$[email protected]..
> hello.. i need help figuring out how to fix this error i
keep running
> into. I
> have a single cell in a table that i want to have a
background and the
> cell has
> numerous hyperlinks. i created the background color in
the single cell
> just
> fine, but now all the hyperlinks have a white background
around them.
> the
> cell is all yellow, but the places that have hyperlinks
are highlighted in
> a
> white background. how can i fix this? if i remove the
hyperlinks
> everything
> looks just fine. if you need me to attach the code, let
me know.
>
>
> -
Have a problem in Formatting output with Escape Sequence
class Welcome
public static void main(String args[])
//Khong the hieu noi
System.out.println("Welcome\tto the world of java");
System.out.println("Happy\tBirthday");
System.out.println("Welcome\" to the world of java");
System.out.println("Bo\ttay");
System.out.println("Be\ttay");
System.out.println("Nhe\ttay");
System.out.println("Welcome\tto Viet Nam");
System.out.println("?Welcome\tto Viet Nam");
System.out.println("!Welcome\tto Viet Nam");
System.out.println("*Welcome\tto Viet Nam");
System.out.println("#Welcome\tto Viet Nam");
System.out.println("$Welcome\tto Viet Nam");
System.out.println("%Welcome\tto Viet Nam");
System.out.println("^Welcome\tto Viet Nam");
System.out.println("&Welcome\tto Viet Nam");
System.out.println("/Welcome\tto Viet Nam");
System.out.println("Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println(" Welcome\tto Viet Nam");
System.out.println("Bodsdsadsme\ttay");
System.out.println("come\tto");
Let's explain for me...ThanksDou you have a question ?
The character and string escape sequences allow for the representation of some nongraphic characters as well as the single quote, double quote, and backslash characters in character literals and string literals:'\b' /* \u0008: backspace */
'\t' /* \u0009: horizontal tab */
'\n' /* \u000a: linefeed */
'\f' /* \u000c: form feed */
'\r' /* \u000d: carriage return */
'\"' /* \u0022: double quote */
'\'' /* \u0027: single quote */
'\\' /* \u005c: backslash */In case you are using Java 1.5, you might be interested in System.out.printf(), which usesformat string. -
How to export table data with coloring of cell according to value.
Hi all,
I am using jdeveloper 11.1.1.6
i want to export table data with lot of formatting. like with coloring of cell according to value and so many.How to do that?Hi,
like with coloring of cell according to value and so many.How to do that?
Answer is, you can't
Frank -
How to download alv grid output(with field catalog) into excel file format
Hi all,
How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
Please help.
Regards,
Satya.Hi,
On list where alv is displayed, select export icon( green color -> ),select spread sheet.
This will display records in Excel sheet. -
Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format. Siebel wants to send the data as xml to BI but not sure of the BI capabilities on giving WSDL embedded with XSD (input is a hierarchical)
Hi All,
I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
Please let me know if there is any oracle functionality to do this.
If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
For eg, /$APPL_TOP/ar/1.0/sql or something.
Regards,
Swapnil K. -
Formatted HTML output with Spry regions - is it possible?
I have recently begun using the XML export extension in
conjunction with an Access database to output dynamic data into a
page with a Spry master/detail setup. So far, my simple example is
going great, but I've run into a snag that I need some help with.
To explain what I'm doing - it's a simple article page with
the list of articles on the left with the title and date and the
article title and full contents on the right hand side. So far it's
all working very well, updating in real time when I click an
article title on the left. The problem is the output with this one
field which stores not only text, but also HTML formatting that is
generated by a wysiwyg editor used on the article creation side of
this little app. This HTML formatted content is the article body
and is stored in a field named the same - "body". With traditional
ASP, the HTML formatting displays as expected and all is well, but
with Spry, it doesn't output formatted HTML, but instead shows the
content and HTML code together as text. How can I get this one
field ("body") to be output so all the HTML formatting is shown?
This is my simple page example. Click through and you'll see
what I mean.
http://www.shoestodyefor.com/ajax.asp
Here's the section of code in question regarding the output
on that right hand panel where the body is displayed for each
article:
<div spry:detailregion="ds1">
{title}<br />
{entryDate}<br />
<br />
{body}
/div>
Is it possible to have that {body} section shown so the
dynamically created HTML code from the wysiwyg editor is displayed
correctly?Steve Skinner wrote:
> Is it possible to have that {body} section shown so the
dynamically created
> HTML code from the wysiwyg editor is displayed
correctly?
The version of Spry that ships with Dreamweaver CS3 (Spry
1.4) doesn't
support the type of output created by the XML Export
extension.
This issue has been corrected in Spry 1.5, but no plans have
been made
public for integrating Spry 1.5 into Dreamweaver CS3. You
would need to
download Spry 1.5 from
http://labs.adobe.com/technologies/spry/.
Details
of how to hand-code the fix for output from XML Export are
here:
http://labs.adobe.com/technologies/spry/samples/data_region/HTMLFragsInXMLSample.html
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Inner table output to Excel with colored cells?
Hi!
I would like to output my inner table into Excel ducoment.
And it is important to have Excel document with colored cells.
I have searched for this solution, but could not find...
Any help will be awarded!
Kind regards, M.Hi,
You can use function module "XXL_SIMPLE_API"
or alternatively use "XXL_FULL_API".
On the import, parameter name "N_KEY_COLS" is used to colour fields. The headings are automatically coloured. 1 is the default value.
This reply is nearly 1 year after the last post
Regards,
Daniel -
PO output with XML and PDF format
Hi All,
I need PO output with XML and PDF format. when I give print it shld go to vendor with xml and pdf format through mail. please kindly guide me on this .
Thanks in advance
JKhi,
try this code to get in pdf form
REPORT zsuresh_test.
Variable declarations
DATA:
w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
W_bin_filesize TYPE i, " Binary File Size
w_FILE_NAME type string,
w_File_path type string,
w_FULL_PATH type string.
Internal tables declaration
Internal table to hold the OTF data
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
Internal table to hold the data from the FM CONVERT_OTF
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
This function module call is used to retrieve the name of the Function
module generated when the SMARTFORM is activated
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_form_name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = w_fmodule
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Calling the SMARTFORM using the function module retrieved above
GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
format of the output
w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box
" for print preview
w_cparam-getotf = 'X'.
Printer name to be used is provided in the export parameter
OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'.
CALL FUNCTION w_fmodule
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = w_cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = w_outoptions
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
t_otf[] = t_otf_from_fm-otfdata[].
Function Module CONVERT_OTF is used to convert the OTF format to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
To display File SAVE dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = w_FILE_NAME
path = w_FILE_PATH
fullpath = w_FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_bin_filesize
filename = w_FULL_PATH
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = T_pdf_tab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
reward points if useful,
siri -
Can we Compare PDF Output with CSV format
Team,
Can we Compare PDF Output with CSV format.
In Excel I need to two text boxes asking us to browse the files and compare the files PDF & CSV format.
Please suggest me if we have solution for this.
Thanks!
KiranHi
I'm afraid the Excel Application does not support this function currently, I am suggesting you to take advantage of a third party component to achieve this goal.
Thanks for your understanding.
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
[solved]pacman output piped to grep with color result?
Hi. Thanks for reading. I am looking for a command with the following function:
1. It searches only the pacakge name, not the description.
2. However, when a package's name matches the search pattern, it shows the description of this package as well.
After searching in the forum, now I am using something like:
pacman -Ss test_string | grep --color=always -B1 -v '^ ' | less -R
It works nicely in terms of my two requirements. However, I could not get the color output (I have pacman color option) from pacaman even if I used less.
On the contrary, the following command has normal color output
ls --color | grep test_string | less -R
Did I do anything wrong?
Thanks...
Last edited by shallpion (2013-09-22 04:55:33)Mr.Elendig wrote:
shallpion wrote:Did I do anything wrong?
Yes, you are not using expac.
expac -S '%r/%n\n %d' python
extra/python
Next generation of the python high-level scripting language
community/pypy3
A Python3 implementation written in Python, JIT enabled
Note that it will match provides as well as the package name.
Sidenote: kittypack will 'soon' have this feature too, but it uses https://archlinux.org/packages so it is independent of the status of your sync db.
Sorry I am confused... I know expac but it doesn't look like the function I was looking for... I wanted to search those packages whose *name* contains a string. For example the pypy3 is not what I wanted since it only has "python" in its description... -
Oracle Reports - Unable to generate report with colored image in bitmap mod
Hi,
I am using Oracle reports 6i.
I am generating a post script[.ps] file using bitmap mode.
The layout contains an image. The image is stored in oracle database which is colored image.
But when the report is generated same is being generated with gray color.
Could any one advise on resolving this issue? The objective is to generate the report with colored image and not gray or black&whiteWhat kind of images do you have? Reports only supports a few formats, e.g. JFIF. So, if you have JPG images with EXIF meta information in the header, you have to remove those first.
when the report is generated same is being generated with gray color.What happens if you sent the output directly to the printer?
And what happens if you create a PDF file instead of Postscript?
Maybe you are looking for
-
DVD freeze when play back on dvd player
Hello, I create a DVD with DVD SP 3.01, When I play back the dvd in 3 brand of dvd player it freeze after 12 min of playback for about 2 sec and after continue to play to go to an other freeze about 10 to 12 min after. It does that in dvd with 25 min
-
NodeIterator Objects different in ChangeAwareClassLoader and bootloader?
I have an application that does xpath stuff, and just got an error java.lang.LinkageError: loader constraint violation: when resolving method "com.sun.org.apache.xpath.internal.XPathAPI.selectNodeIterator(Lorg/w3c/dom/Node;Ljava/lang/String;)Lorg/w3c
-
Internet is on, But Skype is stuck on 'connecting?'
I restarted my computer to try to fix another a game and in the process of which, when i started my computer back up i was greeted by my skype not working... Help!
-
Scripting InDesign and XML tables
I am trying to get around the fact that InDesign CS2 forces you to import XML data into tables as the WHOLE table. I just want to link cells to data without having to build the whole tables in XML because the table layout changes. I do not want to us
-
Hello, I have a question. I know how to connect BOBJ 4.0 to SAP BW very well but I want to know how to connect BOBJ with oracle. I have questions like do we have to create a background id in both systems(Oracle and BOBJ)? if you have some links, can