How to Output Rtf
I need to create an app that reads text from text files and outputs the text to an rtf file, which will later be read into a Word document.
Although my app will not contain any kind of UI, I've discovered that the javax.swing.text and javax.swing.text.rtf packages might let me accomplish my goals. I also found following snippet, which illustrates how to output some RTF:
private void writeFile()
FileOutputStream stream;
try
stream = new FileOutputStream("test.rtf");
RTFEditorKit kit = new RTFEditorKit();
Document doc = kit.createDefaultDocument();
SimpleAttributeSet bold = new SimpleAttributeSet();
StyleConstants.setBold(bold, true);
doc.insertString(0, "TITLE", bold);
doc.insertString(doc.getLength(), "\n\r" , null);
doc.insertString(doc.getLength(), "Bla bla bla", null);
doc.insertString(doc.getLength(), "bla bla bla", null);
kit.write(stream, doc, 0, doc.getLength());
catch (FileNotFoundException e)
e.printStackTrace();
catch (IOException e)
e.printStackTrace();
catch (BadLocationException e)
e.printStackTrace();
}What I need to do now is figure how to create the RTF for a table. Does anyone know how to do this?
Thanks much...
Hi pdevaal,
Thanks for reply, For first question I test it and it works but it is possible to add MIMETYPE on server other wise I have to modify every Run report procedure for this to work.
For second question I just view the slide show by Oracle to create template for spreadsheet output.
Regards, Khawar
Similar Messages
-
How to create rtf template to view report in Word and Excel, with numeric f
Hi,
Please help me!
How to create rtf template to view report in Word and Excel, with numeric formatted fields (like this 999 999 999,99 with spaces between numbers) and then end user be able to process those fields with Excel tools (sum, etc).
Thank you.From what I have seen Excel can not handle 999 999 999.00. You can use 999999999.00 and then format it as you want in the xls bt you can not have values like 999 999 999.00 coming from publisher output and have functions on the values in Excel
Tim -
How to migrate rtf Templates in XML Publisher ?
Hi All,
I want the script so that i can download and upload the RTF files directly from my development instance to my production instance.
For this i have come across 3 links
How to migrate rtf Templates in XML Publisher?
http://download.oracle.com/docs/cd/B40089_10/current/acrobat/120xdoig.pdf
unable to migrate physical files using XDO Loader utility
and from here i am running this command from /home/aryan directory
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD fnd -JDBC_CONNECTION sharp.apps.com:1522:tst1 -LOB_TYPE TEMPLATE -APPS_SHORT_NAME CUSTOM -LOB_CODE ZEMP -LANGUAGE en -TERRITORY US
but it is giving me error "ksh: java: not found". could anyone can tell me how and from where i have to run the download and upload command
Thanks
AryanHi Hussein,
I tried with applmgr also and still for java -version it is giving me error ksh Java not found
and for which java it is giving me error no java found in different directories path.
Thanks
Aryan -
How to output sound to RCA cables?
I give up! I can't for the life of me figure out how to output the sound from my Macbook to play on my stereo or TV which use RCA cable hook-ups.
I got the VID ADPT MINI-DVI TO VIDEO ADAPTER-GEN but that only adapts the video, not the sound. Do I have to get some kind of optical to analog adapter?This would do the trick, although you can probably find something at Radio Shack for less.
http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?mco=FFB 21895&fnode=home/shopipod/ipod_accessories/cablesdocks&nplm=TN779LL/A
I got an iPod kit with a power supply, extra dock, and a Monster Cable (yeah I think they're overhyped) mini jack to RCA connector.
There are a bunch of ways you can do this. If you've already got long enough RCA cables, these would do the trick:
http://www.radioshack.com/product/index.jsp?productId=2103710
Or if you have a short distance, maybe something like this (doesn't say how long it is):
http://www.radioshack.com/product/index.jsp?productId=2427991
There are more attractive versions of this type of adapter. Radio Shack shows at least a dozen from different companies. -
How GET Output to Excel with Oracle9i Report using OC4J
how GET Output to Excel with Oracle9i Report using OC4J.
I FINISHED THE SETPS CONCIDERING THE JSP CODE NEEDED TO GET THE EXCEL OUTPUT ON LOCAL MACHINE.
I NEED TO PUBLISH THIS REPORT THROUGH APPLICATION SERVER.
THE QUESTION IS:
1- HOW TO START AN OC4J INSTANCE FROM ORACLE 9I DS FOR THIS REPORT?
2- WHERE (PATH) TO PUBLISH THE REPORT ON THE APPLICATION SERVER?
3- WHAT IS THE DEFAULT URL TO RUN THIS REPORT AND WHERE TO PUT IT?
4- HOW TO MAKE MAPPING FOR DIRECOTRY PATH TO TRANSLATED AS URL FOR THIS REPORT?
5- IF ANY ONE CAN GIVE ME THE FULL CODE TO RUN AND CALL SIMPLE JSP REPORT TO BE VIED IN INTERNET EXPLORER.
THANK YOUHi,
I can't answer to all your questions, however I can tell you that:
2) The directory where to put the report file is specifiend in a file named
<serverName>.conf
in the sourceDire property
<property name="sourceDir" value="/directory/dove/mettere/i/report"/>
that you can find under ORACLE_HOME/reports/conf
3) The URL is
http://<server IAS address>:<port number>/<jsp file path>/<repName>.jsp?server=<report server name>&userid=<user>/<pwd>@<DB conn string>[&<param>=<valore>[&...]]
5) In IE you have only to set the previous URL in the address bar.
Hope this helps you
Bye
Raffy -
Name of the predefined style in the template removed in the output-RTF
When using predefined named styles in an RTF-input-template, these get removed from the resulting output-document.
* Create a BI-Publisher -project and use an rtf-file with a predefined style (you can define one on the fly by changing the default style and call it eg. "MyStyle")
* Type in some text in the template-rtf marking it with "MyStyle"-style
* Save your template, add a dummy dataset and then view it as rtf-output
* The Name of the predefined style is not in the style-list of the output-rtf anymore.
Basically, BI-Publisher seems to remove the names of the styles in the list of the rtf and thus making it impossible to work consistently with styles afterwards for people wanting to modify the resulting rtf using a in-house-style .
Does anyone know a workaround for this ?
Thanks,
PeterHi,
According to your requirement there is no such standard SAP report.
Develop a custom Z-report using LDB PNP in Tcode SE38.
Hope this helps.
Thanks,
Sarika. -
How To Read RTF file in JAVA? Using iText?
How To Read RTF file in JAVA? Using iText?.....
import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.rtf.*;
public class RTF3 {
public static void main(String[] args) {
// System.out.println("This example generate a RTF file name Sample.rtf");
// Create Document object
Document myDoc = new Document();
try {
// Create writer to listen document object
// and directs RTF Stream to the file Sample.rtf
RtfWriter2.getInstance(myDoc, new FileOutputStream("Sample.rtf"));
// open the document object
myDoc.open();
// Create a paragraph
Paragraph p = new Paragraph();
p.add("Helloworld in Rtf file..amazing isn't");
// Add the paragraph to document object
myDoc.add(p);
catch(Exception e) {
System.out.println(e);
//close the document
myDoc.close();
Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.Rectangle.width()F
at com.lowagie.text.rtf.document.RtfPageSetting.rectEquals(RtfPageSetting.java:433)
at com.lowagie.text.rtf.document.RtfPageSetting.guessFormat(RtfPageSetting.java:362)
at com.lowagie.text.rtf.document.RtfPageSetting.setPageSize(RtfPageSetting.java:341)
at com.lowagie.text.rtf.RtfWriter2.setPageSize(RtfWriter2.java:248)
at com.lowagie.text.Document.open(Unknown Source)
at view.RTF3.main(RTF3.java:23)
CAN you HELP me?import com.lowagie.text.Document;
import com.lowagie.text.rtf.parser.RtfParser;
import java.io.FileInputStream;
String inputFile = "sample.rtf";
Document document = new Document();
document.open();
RtfParser parser = new RtfParser(null);
parser.convertRtfDocument(new FileInputStream(inputFile), document); -
How to output video to TV or Home Theatre? (iphone)
How to output video to TV or Home Theatre? (iphone)
I recently bought a AV projector and was asked by a smirky but envious friend the same question, after watching me hook up my powerbook, having already purchased an ipod video 30gig with the UNIVERSAL DOCK with remote control and ifrared remote control I remembered reading about it also working with the iphone, so it having a s-video output with a audio mini output port, I plugged the iphone into it and it came up with a little message saying this is not a iphone compatible device, and asked me to turn on airport, I ignored the request and it just clicked over to the itunes section, I picked a video and presto instant big screen projection TV off the iphone, How IMPRESSIVE! then I went to utube launched a utube video and wow how cool it also played seamlessly, although it pays to let the Youtube videos buffer for a minute to get a better play off the EDGE net work verse the Wi-Fi, I plan on having lots of out door theatre shows this summer with this very compact multi-media package, What a hoot! Get the universal dock no glitches!
-
How to output full image path to logger/console
Hi All
I'm just starting to get my hands dirty with the lr sdk and could do with a little guidance.
For part of a plugin I need to retrieve the full path to each image, and although I can achieve what I want I'm struggling to print the path to the console/logger and can't understand why.
Here's a snippit of code to illustrate things:
for photo in exportSession:photosToExport() do
filename = photo:getFormattedMetadata( "fileName" )
outputToLog( filename ) -- Works as expected
folderName = photo:getFormattedMetadata( "folderName" )
outputToLog( folderName ) -- Works as expected
local path = LrPathUtils.standardizePath(photo:getRawMetadata("path"))
outputToLog( path ) -- Output is always blank
-- and yet when passed to exiftool the path is correct and works as expected
LrTasks.execute("exiftool -Copyright=\"Imaginary person\" \""..path.."\"")
end
Basically I can get the path and use it as part of an exiftool command, but can't work out how to output the path to the log/console for debugging purposes. Am I missing something simple or is this an intentional limitation?
Any help much appreciated.I don't know what the problem is. What device are you outputting to?
i.e. did you try logger:enable( "logfile" ) -- that works for me in OSX to log to a file.
Here is the code I use:
self.logger = LrLogger( logName )
local function logToFile( msg )
local f = io.open ( self.logFilePath, "a" )
if f == nil then
Debug.pause( "can't open log file", self.logFilePath )
return
end
f:write ( LrDate.timeToUserFormat( LrDate.currentTime(), "%Y-%m-%d %H:%M:%S"), " ", msg, '\n' )
f:close ()
end
if self.verbose then
--self.logger:enable( 'logfile' ) -- enable everything to log file.
self.logger:enable( logToFile )
else
local actions = {
-- debug output is suppressed when not logging verbosely
trace = logToFile,
info = logToFile,
warn = logToFile,
error = logToFile,
fatal = logToFile,
self.logger:enable( actions ) -- suppress trace & debug.
end
R -
How to output data when converting labview vi into matlab mex functions
Hi,
I am a fairly new user to labview and am currently working on labview
7.1. I have created a labview vi which can extract data from ni daq
6070e in real time. The problem is that this code has to be converted
so that it can be used with matlab.in order to do that i am using math
interactive tool kit which converts the labview code into mex files
which can then be used in matlab. Unfortunately i have not been able to
figure out how to output this data so that it can be processed in
matlab easily. i cannot afford any loss of information and all the
output must happen in real time. the o/p must take place after the fft
has been done. i am attaching the vi for convenience.There are 10
broken wires ,and this is the place where i want the o/p to be
generated.
Also do let me know if this vi can be further improved.
Regards
Attachments:
RT_loop2ver4_working.zip 642 KBManuj,
You seem to have misunderstood the way in which LabVIEW processes data. The code that you have produced will run in exactly the same way without the need for the case structure.
The code does not actually run the data from the previous case. It is merely processing data from the previous loop iteration, regardless of the case. If you were to remove the case structure, leaving only one copy of the code intact, and remove the toggle switch you have produced, or used the shift register which, I assure you would have worked, then you will have exactly the same functionality.
I have attached an example that uses the shift register to toggle cases, but also iterates that the case structure is not needed by using the same feedback node (and code) without a toggle switch or case structure.
Hope this helps you optimize your code
Regards
AdamB
Applications Engineer
National Instruments UK
Applications Engineering Team Leader | National Instruments | UK & Ireland
Attachments:
CASE_NO-CASE_Example.vi 24 KB -
How to output FTP file with Code Page 8400?
Hi gurus,
As we know we can use GUI_DOWNLOAD to download fiel with specific Code Page,
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = 'E:\TEXT.TXT'
* confirm_overwrite = 'X'
codepage = '8400' "Chinese
CHANGING
data_tab = i_file
EXCEPTIONS
file_write_error = 1
OTHERS = 24.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
But my question is how to output file into FTP server with specific code page 8400?
call function 'FTP_R3_TO_SERVER'
exporting
handle = p_handle
fname = p_filename
character_mode = 'X'
tables
text = i_file
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.Thanks but it is not my anwser
I want to output file to FTP Server with specific code page like
GUI_DOWNLOAD -
How to Output Rich Text Format.
Hi everyone, i use a rich text editor called tiny mce in my web application. After i click the submit button the value inside the text area would be saved in my database including the HTML tags e.g. <i>Sample Report edited via Tiny MCE Rich Text Editor<i>. I need to output the text in a webuijsf static text component but the moment i see the output the tags are still there and the text is not in italics format. Does anyone know how to output it in static text with the design in it?
It is not updated for more than 1 years and it is dropped by Sun and users were recommended to migrate to ICEfaces.
[http://woodstock.dev.java.net]
The Woodstock release 4.2 is the last official version of Woodstock that Sun will release. Sun will continue to support its customers that have built on top of Woodstock 4.2. The Project Woodstock code is still available, and community members can still create new features or enhancements. For future development or migration of existing Woodstock projects, Sun is officially endorsing ICEfaces as the replacement technology for Woodstock. Also see [http://www.nabble.com/Woodstock-Migration-Path-to-ICEfaces-td21057513.html], although I would recommend RichFaces above that. It is only that it doesn't have a drag'n'drop palette for Netbeans, so it is not reachable for blind visual developers. -
How to output new /new other than new/
I use dom to parse a document to xml String.if a xml node doesn't have node value ,it will output <new/> but not <new></new>.we use this format (<new></new>) to transfer with remote mechine,so how to output this format.
following is my sample code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element root = document.createElement("root");
document.appendChild(root);
Element child = document.createElement("new");
root.appendChild(child);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
Properties properties = transformer.getOutputProperties();
properties.setProperty(OutputKeys.ENCODING, "utf-8");
properties.setProperty(OutputKeys.METHOD, "xml");
properties.setProperty(OutputKeys.VERSION, "1.0");
properties.setProperty(OutputKeys.INDENT, "yes");
properties.setProperty("{http://xml.apache.org/xslt}indent-amount", "4");
transformer.setOutputProperties(properties);
StringWriter sw = new StringWriter();
transformer.transform(new DOMSource(document), new StreamResult(sw));
System.out.println(sw.toString());I think that maybe to set some property to the transformer outputproperties.
but I don't know what property will done.
any suggestion is appreciatedThanks for your respons.My manager has accentuated this format before .maybe I will ask why.
However I don't think it will done after adding child.appendChild(document.createTextNode(""));
it still output <new/>.
I have writed a function to format this xml String like this:
* format <new/> String to <new></new>
* @param xmlString
* @return String
public static String formatXml(String xmlString){
int idx = xmlString.indexOf("/>");
while(idx != -1){
String temp = xmlString.substring(0,idx);
int idx1 = temp.lastIndexOf("<");
String key = temp.substring(idx1+1,idx);
xmlString = xmlString.replaceAll("<" + key + "/>", "<" + key + "></" + key + ">");
idx = xmlString.indexOf("/>");
return xmlString;
}but i still won't to use it less than the end. -
How to output the digital clock and synchronization signal from the NI USB-6211
Hello,
I need to connect the NI USB-6211 to control a digital to analog convertor chip (AD5541). However, this chip requires three input signals :1) Clock input, 2) Logic input or a synchronization signal and 3) Signal Serial Data input (CS, SCLK, DIN).
how to output the digital clock and the synchronization signal from the NI USB-6211?Hi SaberSaber,
You should be able to use the counters to generate a pulse train that could be used for clock and synch purposes.
Hope this helps. Let us know if you have more questions.
Dave C.
Applications Engineer
National Instruments -
How to output to an excel file?
Hi,
I have written a program that gets data from the database and I like to find out how to output the data to an excel file. I have read about similar topic on the discussion board and the solution are for the online application. Mine is a desktop application. The user can specify what the destination file is. Can anyone help. Thanks.The simpliest way is to take your data and write it to a Comma Dilimeted File which Excel can read without any problems or user intervention. You would use an ObjectOutputStream. Hope this helps.
Maybe you are looking for
-
Would I be able to get a replacement?
Hey there guys! This is my first time ever posting on apple, so excuse me if I'm in the wrong section. Recently (end of November 2012) I began a plan with Telstra (I'm in Australia) for my iPhone 5. While I was on holidays in December, I accidently d
-
I am getting an error while requesting a new jsp
HTTP ERROR: 500 No Java compiler available RequestURI=/webchat/index1.jsp Caused by: java.lang.IllegalStateException: No Java compiler available at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:224) at or
-
Will the 10 watt charger work with the iPad mini
I hate how long it takes to charge my iPad mini with the 5 watt charger, so I bought a 10 watt iPad charger online. It charges my iPhone 5 but not the iPad mini. The mini recognized it, but it says "not charging" Did I just get a bum charger (only
-
Backup Oracle EBS R12.1.3
Dear friends we have a single node oracle EBS server I need to take backup. kindly provide me the steps or oracle document. the following are the details OS: RHEL 5.7 EBS Version :R12.1.3 DB: 11.1.0.7.0 Thanks.
-
hi all i created form with the following text items 1) branch,class,year,serial,cno,eno 2) branch1,class1,year1,cno1,eno1 i want to insert record into(branch1,class1,year,cno1,eno1) from branch,class,year,serial,cno,eno what will be the code plz than