Writting java graphics and textual data from java application into MS word
By using POI API, I could write textual data into MS word by using
java application. Could any one help me out how to write
Java graphics(i.e. Writting JPanel) and textual data(i.e.IOStream data) both into MS word document.
Thank you for time spent.
Thanks with regards,
Mallik
hi:
Can any one help me out how to read and write in to the MsWord using POI...plz it is very urgent...plz give ur reply to [email protected]
Similar Messages
-
Import data from SQL Server into MS Word document for Mail Merge purpose ?
Hi,
Is it possible to import contacts from SQL Server into MS Word for mail merge purpose or if retrieving data from MS Excel can we update the data in MS Excel sheet without opening it ?
Note: Remember when you open a word document already set up for mail merge, asks you to run the query to return all records from the excel sheet it is connected to.
KhurramWord and the current data source dialog do not really give you any help with that.
You either have to be able to create a View in SQL Server that performs the query you need, then connect to that, or you have to be able to create the correct query manually (or perhaps using some other query tool that can help you), then use VBA to connect
using that query.
For example, if you have been through the connection process once (connecting to a single table) then you will have a .odc (Office Data Connection file) which has the info. needed to connect to the correct server and database. It's a text file with some
HTML and XML inside. You can copy/rename it. Let's say it is called "c:\a\myodc.odc" Then in VBA you can use something like
ActiveDocument.OpenDataSource Name:="c:\a\myodc.odc, _
SQLStatement:="put your SQL statement in here, and if it is long,...", _
SQLStatement1:="put the second part in here"
You get a maximum of either 255 or around 511 characters in the SQL statement, and Word tends to impose some syntax requirements that Transact-SQL does not, so e.g. you may need to quote all your table names.
You can also se an empty .odc file and provide connection info. in the COnnection:= parameter in OpenDataSource.
As background, until Word 2000, by default you would use MS Query to create your SQL query, and MS Query does have facilities that can help you build your query (a bit like the ones in MS Access). That may still be possible (it is a bit harder to find the MS
Query option now, and I am not sure it works with the latest versions of Word). MS Query only works for ODBC queries, and they do not always work correctly when you actually issue the query using ODBC from Word, because of a Word problem to do with Unicode
fields in SQL Server. But you could probably still use MS Query to help you construct your SQL. (It's probably easier to do that in Excel, though).
Peter Jamieson -
Read and Submit Data from Active Application
I do have window application that accept the user and password.
I would like to write an application using C# to write the user and password then hit submit to this active screen.
how can we do this?
hussainHello,
Welcome to MSDN forum.
Your issue is out of support range of VS General Question forum which mainly discusses
the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
You can tell us what type of windows application you are working with, we can check whether another proper forum can support your issue better.
If you are working with Windows Forms app, you can directly consult on Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
If you are working with WPF app, please consult on WPF forum:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf
Here isVisual Studio Language Forums:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages
Best regards,
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. -
Data from multiple application into single application
Hi All,
I have a requirement as below
Suppose there are 4 different cubes and 1 reporting cube .All the 4 cubes are in different servers/geographical regions.I need to get the data into the reporting cube from all the cubes.
The reporting cube is also in a different server
What are the ways or options to achieve this....
Thanks in advance
Regards,
SriramHi
I don't think you can go with partitioning.
My suggestion would be to look at any other options. Export and Import.
Few Question:
1. Do you want to send all level0 data from all the four cubes reporting cubes?
2. Do you want to send only a portion/subset of data to the reporting cube? Is it level0 only or even upper level data?
3. Are all the Four cubes BSO/ASO?
4. Is the reporting cube already in place (OR) Are you planning ASO for reporting cube?
5. How big are your cubes?
Depending on how much amount data & at what frequency you want to push to reporting cube, you may have to look at different options
As Ambuj said, if you can give a bit more on requirement then we can help out
Regards
Amarnath
http://amarnath-essbase-blog.blogspot.com -
Writing data from Java to Excel
Hi,
I am trying to writhe data from Java to an Excel Sheet by using JACOB.
This is my code :
import java.util.*;
import java.io.*;
//import cost.util.*;
import com.jacob.com.*;
import com.jacob.activeX.*;
class XLStock
public static void main(String argv[])
XLStock xls = new XLStock();
xls.main2(argv);
public void main2(String argv[])
System.setSecurityManager(null);
System.runFinalizersOnExit(true);
Vector v = new Vector();
XLSPutItem pi;
String sheetfile = null;
ActiveXComponent xl;
Object xlo=null;
Object workbooks;
Object workbook;
Object sheets;
Variant vOptn = new Variant();
vOptn.noParam();
try
xl = new ActiveXComponent("Excel.Application");
xlo = xl.getObject();
Dispatch.put(xlo, "Visible", new Variant(true));
xl.setProperty("Visible", new Variant(true));
workbooks = xl.getProperty("Workbooks").toDispatch();
Variant vTemp = new Variant(argv[0]);
workbook = Dispatch.invoke(workbooks, "Open", Dispatch.Method,
new Variant[] {vTemp, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn},
new int[1]).toDispatch();
sheets = Dispatch.get(workbook,"Sheets").toDispatch();
pi = new XLSPutItem();
if (pi.Parse("1:A1;ciao;6"))
v.addElement(pi);
for (int i=0; i<v.size(); i++)
pi = (XLSPutItem)v.elementAt(i);
pi.sheet = Dispatch.invoke(sheets, "Item", Dispatch.Get, new Object[] {new Variant(pi.sheetNumber)}, new int[1]).toDispatch();
pi.cell = Dispatch.invoke(pi.sheet, "Range", Dispatch.Get, new Object[] {pi.cellName}, new int[1]).toDispatch();
catch (Exception e)
e.printStackTrace();
pi = (XLSPutItem)v.firstElement();
Dispatch.put(pi.cell, "Value", "ciao");
What happen is that my code always fail at this line :
xl = new ActiveXComponent("Excel.Application");
whit this error :
C:\VJWorks\JNI\jxls>java jxls.XLStock
com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstance(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java)
at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java)
at jxls.XLStock.main2(XLStock.java:53)
at jxls.XLStock.main(XLStock.java:28)
Exception in thread "main" java.util.NoSuchElementException
at java.util.Vector.firstElement(Vector.java:450)
at jxls.XLStock.main2(XLStock.java:79)
at jxls.XLStock.main(XLStock.java:28)
I task that something is wrong in my system configuration.
I work on a Win2000 platform and Office 97.
Someone knows the reason of this error and can suggest what to make.
Thanks in advance.
Antonio M.Antonio, maybe you can post this back to the Jacob list. As an alternative to Jacob, what about Apache POI or writing the data as comma-delimited and opening the file using Runtime?
Hope that may help.
Good luck. -
Insert data from java to oracle object created
Hi
How can i insert data from java to table test with column LIST_QRY_RES_DN_MEMBER_INFO as below after create object type
CREATE OR REPLACE TYPE QRY_RES_SERVICE_VALUES AS OBJECT (
PARAMETER_CODE VARCHAR2(60),
PARAMETER_VALUE VARCHAR2(60)
CREATE OR REPLACE TYPE LIST_QRY_RES_SERVICE_VALUES AS TABLE OF QRY_RES_SERVICE_VALUES;
CREATE OR REPLACE TYPE QRY_RES_OPTIONS AS OBJECT (
SERVICE_CODE VARCHAR2(60),
SERVICE_VALUE LIST_QRY_RES_SERVICE_VALUES
CREATE OR REPLACE TYPE LIST_QRY_RES_OPTIONS AS TABLE OF QRY_RES_OPTIONS;
CREATE OR REPLACE TYPE QRY_RES_MEMBER_INFO AS OBJECT (
VARIABLE_CODE VARCHAR2(60),
VARIABLE_VALUE VARCHAR2(120)
CREATE OR REPLACE TYPE LIST_QRY_RES_MEMBER_INFO AS TABLE OF QRY_RES_MEMBER_INFO;
CREATE OR REPLACE TYPE QRY_RES_DN_MEMBER_INFO AS OBJECT (
DN VARCHAR2(60),
MEMBER_INFO LIST_QRY_RES_MEMBER_INFO,
OPTIONS LIST_QRY_RES_OPTIONS
CREATE OR REPLACE TYPE LIST_QRY_RES_DN_MEMBER_INFO AS TABLE OF QRY_RES_DN_MEMBER_INFO;
CREATE TABLE test(
DN_MEMBER_INFO LIST_QRY_RES_DN_MEMBER_INFO,
NESTED TABLE DN_MEMBER_INFO STORE AS LIST_QRY_RES_DN_MEMBER_TAB
(NESTED TABLE MEMBER_INFO STORE AS MEMBER_INFO_TAB,
NESTED TABLE OPTIONS STORE AS LIST_QRY_RES_OPTIONS_TAB
(NESTED TABLE SERVICE_VALUE STORE AS SERVICE_VALUE_TAB));It appears you are trying to store java objects (types) in a database rather than raw data (string, int, date types) that the object contains. If so, I don't think that ever really caught on. Most programmers store the raw data, then pull it out and populate a class. The problem with storing the object is that new versions of classes come out and your old version is stored in the database. If you just store the data, you don't have to worry about what version is in the database. You can populate the new version of the class with the same data.
Also, others can use sql to query your data and use it for their own use independent of what you intended it for. I think most people use the (browser) based utility that comes with the database to create the tables, normalize them, set up primary keys, set up foreign keys, etc rather then run an sql statement as you did above. -
Extract data from Java to Excel
Apologies for my ignorance in this field but is it possible to extract data from a Java based application (stock charts and the like) directly into Excel? If so could someone please contact me and explain the process in very simple terms as i have no idea how Java works :o)
Many thanks.
GilseyActually I should qualify my "Yes" answer. It is possible for a Java application to output data to Excel (using Jakarta POI for example). Whether it is possible to persuade an existing Java application to do that depends on the application. If it has been programmed to do it, then yes. Or if it has an underlying database where it stores its data, and you have access to that database, it might be possible to extract data from the database into Excel. Otherwise the programming of the application would have to be changed.
-
How to insert into mysql the creation time and modification time from java?
first how?
Second what is better from create the date from java or do it from mysql?
thanks in advace
PedroOne way is to use the GetDate function in mysql. This will set the date as you insert data. insert into table(date) values(getdate())
Anytime you modifiy the table just call the function again and update its fields.
Dont know which is beter to do. In java or on the database side. -
Error MUT-02041 : While exporting the data from Java system.
Dear Friends,
When exporting data from Java system (source system) using SAPINST. We are getting
the below error in 4 of 5 (Archiving SDM Repository) stage.
Error :
MUT-02041 SDM call of createsdmkitjar ends with returncode 2
With this, I am unable to proceed further. Please help me on this to proceed further.
Thanks in advance,
regards,
SrinivasHi All,
I could find the below error log from sapinst.log file.
=============
Info: Exclude components as specified
in /usr/sap/IPD/DVD_JAVA/51033746_1/Installation_Master_6.20_6.40_05_08/IM_AIX_PPC64/SAPINST/COMMON/INSTALL/JMIG/EXCLUDE.XML
Info: Resulting JAR
file: /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
Info: No temporal directory for packing is provided. SDM home directory
will be used.
Info: Pack directory exists already. Remove it first.
Info: Start packing the components of com.gsk in
packedOrigin_com.gsk.jar
Info: Create /usr/sap/IPD/JC02/SDM/program/pack/packedOrigin_com.gsk.jarInfo: The components of com.gsk were successfully packed in
packedOrigin_com.gsk.jar
Info: Start packing the components of local in packedOrigin_local.jar
Info: Create /usr/sap/IPD/JC02/SDM/program/pack/packedOrigin_local.jar
Info: Create /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
Warning: Warning during command execution: No metadata files exist for
development
component 'revtrac_agu11'/'local'/'LOKAL'/'0.2009.08.11.10.56.14'/'0'.
Cannot pack this archive.
No metadata files exist for development
component 'revtrac_aug13eartest'/'local'/'LOKAL'/'0.2009.08.13.14.44.25'/'0'. Cannot pack this archive.
No metadata files exist for development
component 'Aug10_09'/'local'/'LOKAL'/'0.2009.08.10.14.39.29'/'0'.
Cannot pack this archive.
No metadata files exist for development
component 'Aug14'/'local'/'LOKAL'/'0.2009.08.14.10.46.38'/'0'. Cannot
pack this archive.
No metadata files exist for development
component 'Aug14two'/'local'/'LOKAL'/'0.2009.08.14.10.55.21'/'0'.
Cannot pack this archive.
No metadata files exist for development
component 'revtrac_aug11b'/'local'/'LOKAL'/'0.2009.08.13.14.36.43'/'0'.
Cannot pack this archive.
Missing archives may lead to errors after the packed SDM installation
has been extracted later.
Info: This SDM installation has been packed
to /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
To unpack this installation again,
extract /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR and invoke the
SDM command install with parameter extractpackedinst=true
Executed, but finished with warning(s). Return code: 2
Error: Executed, but finished with warning(s). Return code: 2
ERROR 2010-10-21 15:54:48
MUT-02041 SDM call of createsdmkitjar ends with returncode 2
=============
Can you please check this and help me on this to proceed further.
thanks..
Srinivas -
Fetching data from java system
Hi All
I want to fetch the data from Java application into my SAP system how can i fetch that .
Thanks and rgards
Saurabh Khannayou need BI system to do this, need to extract data using reports.
can also do from solman ehp1.
regards
nag -
Exception when connecting to Reporting and Analysis services from Java API
Hello,
I'm trying to connect to Hyperion Reporting and Analysis services from Java API using [Developer's guide|http://www.bidw.in/docs/hs_developer.pdf] .
I get this error:
com.sqribe.rm.ReportMartException: com/hyperion/css/CSSException
at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
at com.sqribe.rm.AASessionImpl.open(Unknown Source)
at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
...My code:
String user = "user";
String pwd = "password";
String host = "my.hyperion.server";
int port = 6800;
try {
Session theSession = SessionFactory.getInstance(user, pwd, host, port);
Repository theRepository = theSession.getRepository();
} catch (UserValidationException e) {
e.printStackTrace();
} catch (UnknownReportMartException e) {
e.printStackTrace();
} catch (ReportMartException e) {
e.printStackTrace();
}I have tried to look at my services running, and it all looks OK. I've checked user/passowrd/port for GSM. What can be wrong?
I also tried to run samples from \BIPlus\SDK\samples\java, e.g. Login.java:
#> java Login user password my.hyperion.server 6800with this effect
com.sqribe.rm.ReportMartException: SystemExceptionError
at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
at com.sqribe.rm.AASessionImpl.open(Unknown Source)
at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
at Login.<init>(Login.java:36)
at Login.main(Login.java:69)I'm sure that I'm connecting to the server because when put wrong passowrd or user as input to Login class I get this:
com.sqribe.rm.ReportMartException: AUTHEN_CSSLoginFailed
at com.sqribe.rm.SessionImpl.convertError(Unknown Source)
at com.sqribe.rm.AASessionImpl.open(Unknown Source)
at com.sqribe.rm.AASessionImpl.internalInit(Unknown Source)
at com.sqribe.rm.AASessionImpl.<init>(Unknown Source)
at com.sqribe.rm.SessionFactory.getInstance(Unknown Source)
at Login.<init>(Login.java:36)
at Login.main(Login.java:69)so it is there but something is wrong later. Any idea what?
Please help.
regards,
Pawel
Edited by: Paoro on 2010-09-27 02:02HI,
I am getting the same error while running the Login file, Did any one resolve this issue?
Please share the solution.
Thanks. -
Return data from Java servlet in form of JSON encoded parameters in Javascr
How to return data from Java servlet in form of JSON encoded parameters in Javascript handler function call?
The same is implemented in php as the following
echo "sT.handleAjaxResponse(";
echo json_encode($response);
echo ");";
How to do the same in Java servlet?
Thanks.With the rising popularity of JSON (especially with Ajax), support for it has started to appear in the Java community. I am not aware of any standardized approach yet, but expect it is likely we'll see that eventually. For now, you probably want to look at a third-party library such as the [JSON in Java Library|http://www.json.org/java/], Jettison, or [Java Tools for the JSON Format|http://jsontools.berlios.de/].
-
How can I set system date from java code?
Hi. I need to set the system date from my application. It must works on Windows7 so the "cmd /C date" must be executed with Administrator privileges.
I tried do it that
Process p = rt.exec("runas /user:" + env.get("COMPUTERNAME") + "\\Administrator \"cmd /C date " + dateYYYYMMDD + "\"");
Then process ask me for password for administrator but it terminates befor i send it. exitCode() returns 1.
Have you some idea how can I do it?
Regards for you.At the very least, you need to read this and follow the advice it gives. That may or may not solve your problem, but it's a bare minimum.
http://www.javaworld.com/jw-12-2000/jw-1229-traps.html -
Uploading Excel File and Reading Data from that File
<b>Hi
Can anyone Please tell me how to upload an Excel File in to the Web Dynpro Application and After that i want to read the data from that uploaded excel file in the Web Dynpro Application to the Web Dynpro table.
Plz help me to solve this.......
Regards
Chandran</b>Hi,
Upload Excel file using File Upload UI
1)Add jxl jar folder in the lib folder of ur project.
2)Go to properties of ur project and add jar to ur project.
3)Using the File upload ui ,browse and upload the file.
4)Write the read file in to ur server location using fileoutput stream.
5)then using code u can read the excelfile from the server location itself.
Here is the code:
IWDAttributeInfo attInfo =wdContext.getNodeInfo().getAttribute("upload");
/** get the name of excel file and storing it in the server with the same name and extention****/
binaryType=IWDModifiableBinaryTypeattInfo.getModifiableSimpleType();
fileuploaded = binaryType.getFileName();
byte b[] = wdContext.currentContextElement().getUpload();
File filename =new File("
<Server name>
<folde name>
" + fileuploaded);
try {
FileOutputStream out = new FileOutputStream(filename);
out.write(b);
out.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
/**Readind from the server**/
int iRows = 0;
try { Workbook wb = null;
Sheet sheet = null;
wb = Workbook.getWorkbook(filename);
sheet = wb.getSheet(0);
int iColumns = sheet.getColumns();
iRows = sheet.getRows();
int i = 0;
//get Cell contents by (COLUMN, ROW);
for (int r = 0; r < iRows; r++) {
for (int c = 0; c < iColumns; c++) {
Cell cell = sheet.getCell(c, r);
characterarray<i> = cell.getContents();
//wdComponentAPI.getMessageManager().reportSuccess("Row"r characterarray<i>);
i++;
wb.close();
Declare Globally
//@@begin others
String fileuploaded;
IWDModifiableBinaryType binaryType;
String characterarray[] = new String[1000];
//@@end
Also look at this blog too /people/perumal.kanthan/blog/2005/03/21/reading-excel-data-from-java-using-hssf-api
Thanks and Regards,
Arun -
Store data from a table into excel sheet and email
Hi all,
I am just wondering, i m not sure where to start. I want to insert data from a table into an excel spread sheet.
I'm working on a stored procedure with 3 input parameters:
1. the actual query
2. userid
3. the column headers (comma separated) - these will be in the same order as the outer select statement in the query itself. I will use the column headers for the respective columns in Excel worksheet.
When the proc is executed, the excel is populated. If the record count is > 65536, then I need to create multiple worksheets in the same excel file.
How can i do that? Can any body please help with this..?We are doing like this ( Not sure whether it is the best method available)
--Get the output of the query (Since the number of columns is not fixed you would have to use dbms_sql package)
--loop through the output and write into a file, for example test.csv, using UTL_FILE package
--load the file into a blob variable(we are doing it by loading it into a table)
--For mailing You can use the below package
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Mailing code we are using is given below:
CREATE OR REPLACE procedure xls_mail(
p_sender varchar2, -- sender, example: 'Me <[email protected]>'
p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
p_subject varchar2, -- subject
p_text varchar2, -- text
p_filename varchar2, -- name of xls file
p_blob blob -- xls file
) is
conn utl_smtp.connection;
i number;
len number;
BEGIN
conn := demo_mail.begin_mail(
sender => p_sender,
recipients => p_recipients,
subject => p_subject,
mime_type => demo_mail.MULTIPART_MIME_TYPE);
demo_mail.begin_attachment(
conn => conn,
mime_type => 'application/xls',
inline => TRUE,
filename => p_filename,
transfer_enc => 'base64');
-- split the Base64 encoded attachment into multiple lines
i := 1;
len := DBMS_LOB.getLength(p_blob);
WHILE (i < len) LOOP
IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(p_blob, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
END LOOP;
demo_mail.end_attachment(conn => conn);
demo_mail.attach_text(
conn => conn,
data => p_text,
mime_type => 'text/html');
demo_mail.end_mail( conn => conn );
END;
Maybe you are looking for
-
How do I converting PDF to editable Word?
I've follwoed the onscreen directions multiple times over the past week but have been unable to acheive a successful conversion. The uploading file to Adobe ExportPDF online monitor just keeps going round and round in circles for HOURS! There is no s
-
White screen after Quicktime Pro 7 captures
I use an automator script in combination with iCal and Quicktime Pro 7.6.6 to capture video content overnight from a commercial satellite. Most mornings when I wake the screen from sleep (I don't put the processor to sleep) Quicktime Pro has successf
-
How to create a central system on TDMS control system
Seems the central system on the TDMS control system is an alias. Which transaction to create it? Thanks!
-
Multiple index entries for single object.
Hi, Can someone guide me whether coherence allows multiple keys to be inserted in an index for given record(value)? I mean I will insert a single 'value' in the cache and multiple keys for it in the index, and I should be able to search that 'value'
-
Copy of my libraries and play list of my Ipod
I backed up my ipod, but when I restore the backup "only gets me the pictures and I lose libraries and playlists." Why?