Giving a specific path to the reading from excel application
Hello, i want to know there is a way of giving a specific path to an application (reading from excel sheet) without all the time getting to enter the path? if someone could help. i'm using labview 8.0
Regards,
Tchaou
you could just use a path constant. Drop a path constant on the BD and right click on it and select browse and then find the file you want.
Joe.
"NOTHING IS EVER EASY"
Similar Messages
-
Reading the data from excel file which is in application server.
Hi,
Iam trying to read the data from excel file which is in application server.
I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
I tried just reading using open data set and read data set it is giving junk characters.
Please suggest me if you have any solution.
Best Regards,
Brahma ReddyHi Narendra,
Please see the below code I have written
OPEN DATASET pa_sfile for INPUT in text mode ENCODING DEFAULT MESSAGE wf_mess.
CHECK sy-subrc = 0.
DO.
READ DATASET pa_sfile INTO wf_string.
IF sy-subrc <> 0.
EXIT.
else.
split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
wa_upload-field34 wa_upload-field35 wa_upload-field36 .
wa_upload-field1 = wf_field1.
wa_upload-field2 = wf_field2.
append wa_upload to int_upload.
clear wa_upload.
ENDIF.
ENDDO.
CLOSE DATASET pa_sfile.
Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
Please suggest me any other way.
Thanks for your help,
Brahma Reddy -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
How to read two text files using the Read from spreadsheet.vi and then plot it
I need to read two text files using the read from spreadsheet function and then plot these files over time.
The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
I really appreciate any help..thanks
Attachments:
RMS.txt 1 KB
FREQUENCY.txt 1 KBFrom NI Example Finder:
Write to Text File.vi
Read from Text File.vi
Jean-Marc
LV2009 and LV2013
Free PDF Report with iTextSharp -
How to store the data read from excel using java code in Ms access database
Hi. I wrote a code to read the data from excel. May i know how can i save it to Ms access database using java. Also i have many excels. So i should not connect the database using DSN. So is there any other way to achieve this?
kramish wrote:
Im pretty sure that Access does support JDBCNo it does not. It supports ODBC.
just doing a quick Google came up with some pages:
http://blog.taragana.com/index.php/archive/access-microsoft-access-database-from-java-using-jdbc-odbc-bridge-sample-code/
http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
Both articles explains how to use the jdbc-odbc bridge. I think I've seen a pure jdbc driver for access but it wasn't from Microsoft and it wasn't free.
Kaj -
Retrieving Jar path in the HD from within the jar?
I have a small problem. I wrote a program which is packed in a jar file and this program is able to compile and run java files (Which I do by running javac and java processes) but the kind of files that this program compiles requires some other libraries inside the same package (In the jar file) so I am wondering how can I retrieve the jar path in the harddisk from within this jar because at the moment I ask the user where the program is and I think it is kind of ugly to ask the user where the program is from within the exact same program we are looking for.
Hope I made myself understandable.
Best Regards
NooKThanks for the answer. I mistakenlly ended writing a new thread (New to the forum)
but if you would kindly look here, I have other problem now which I have been working on for a whole day.
http://forum.java.sun.com/thread.jsp?thread=524717&forum=31&message=2514471
Best Regards
NooK -
How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
.exe reading from Excel files
Hi everybody,
I know similar questions have been asked lots of times but while searching the forum didn't find an anwer to my problem.
I created an exe file (using exe4j) of a java application which reads form Excel files. Although it works when I run it from my editor, when running the exe file it cant find the Excel file. More specifically I have this error:
"java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
In order to read from excel files I use POI. I used it so as not to use ODBC driver and make it possible to run in every computer. When adding the driver, the exe works.Do you know a way to make it work without having to install the Driver?
Thanks in AdvanceYou need database drivers to read excel spread sheets?
Also, why did you make it an exe? just jar it and be done with it. -
Cannot retrieve the data from excel sheet
hi all ...
i am trying to retrieve the data from excel sheet and at the same time i am inserting the data into mysql database.
code is as follows
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn1=DriverManager.getConnection("jdbc:odbc:"+estr,"",""); Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+ t_dsn ,"root","manager"); sql="select * from student_info"; srch2 = conn.prepareStatement(sql); rs1 = srch2.executeQuery(); String query = "select * from ["+einput+"$]"; String query1= "select count(*) from ["+einput+"$]"; st = conn1.createStatement(); rs = st.executeQuery(query); ResultSetMetaData rsmd = rs.getMetaData(); c = rsmd.getColumnCount();//gets the column count rs1 = st.executeQuery(query1); while (rs1.next()) //loop to get no. of rows { r = rs1.getInt(1); } rs = st.executeQuery(query); for(i=1;i<=r;i++){ rs.next(); for(j=1;j==c;j++) { a = rs.getString(j); b= rs.getString(j); d = rs.getString(j); } rs1.next(); PreparedStatement ps2 = conn.prepareStatement("insert into materials_out values(?,?,?)"); ps2.setString(1,a); ps2.setString(2,b); ps2.setString(3,d); ps2.executeUpdate(); } }catch(Exception e){ e.printStackTrace(); }
but it is showing error as :
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at Outward_register.jButton2ActionPerformed(Outward_register.java:368)
at Outward_register.access$400(Outward_register.java:23)
at Outward_register$5.actionPerformed(Outward_register.java:312)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
please help me ...please help me ... The question has nothing to do with 'getting' data from excel and certainly not with putting it into MySQL.
The stack trace specifically tells you that your connection string is wrong.
It also tells you which connection string is wrong.
Which you can use to determine specifically which one is wrong. And which you did not provide that info to us. -
Can anybody tell me how to send/receive the sms from java application
Hi All,
Can any body tell me, how to send/receive the sms from java application to mobile phones.
I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
the following error.
Cannot connect to GSM Device, error : -11Which jsms? Google finds several.
Try the website where you downloaded it. -
Can any body tell me, how to send/receive the sms from java application
Hi All,
Can any body tell me, how to send/receive the sms from java application to mobile phones.
I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
the following error.
Cannot connect to GSM Device, error : -11The best place to ask your question is at the JSMS website, forum or mailing list since this is no error that directly comes from a class belonging to the core Java classes.
-
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
Error in reading from excel file
hi,
I have written a program which reads from excel file
and based on the value of the column i have to do something.
Everything is fine but when i run it, it produces an error message
Exception: For input string: "851.0"
the value 851.0 is acually the value of the first column.
Here is the code and i hope someone can help me to find the solution
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection( "jdbc:odbc:exceltest" );
Statement st = con.createStatement();
ResultSet rs = st.executeQuery( "Select * from [Sheet1$] " );
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
while (rs.next()) {
for (int i = 1; i <= numberOfColumns; i++) {
if(i==1){
String columnValue1 = rs.getString(i);
custNo =Integer.parseInt(columnValue1);
// System.out.println(columnValue1);
found=search(custNo);
if (found==false)
insert(custNo);
System.out.println(columnValue1);
else if (i == numberOfColumns && found==false)
String columnValue = rs.getString(i);
if(columnValue=="a")
incrementCusta();
else if (columnValue=="b")
incrementCustB();
else if(columnValue=="c")
incrementCustc();
else if(columnValue=="d")
incrementCustId();
System.out.println("");
st.close();
con.close();
} catch(Exception ex) {
System.err.print("Exception: ");
System.err.println(ex.getMessage());
}Maybe 851.0 is float value, not string.
Try Object columnValue1 =
rs.getObject(i); instead of String
columnValue1 = rs.getString(i);
You are absolutely right i actually change the line
custNo =Integer.parseInt(columnValue1);
into
custNo =Double.parseDouble(columnValue1);
Thanks alot :) -
Java Heap Space error while reading from Excel
Hello,
I have a data flow which reads from excel and updates records in an oracle table.
When the data flow tries to read the excel I get a java Heap space Error.
Error preparing to read <SUPP_STG3_FILE1>: <Java heap space>.
Data flow <DF_SUPP_STG3_UPD> is terminated due to error <58105>.
I have configured Excel Adapter since the server is on UNIX. BOExcelAdapter shows status as red once the execution fails. Before that BOExcel adapter status is green.
BOExcelAdapter Trace:
1/13/12 10:57:38 PM Thread[Thread-6,5,main] Received an error message from the message broker. [Communication failure. Read timed out]. Will exit adapter immediately.
1/13/12 10:57:47 PM Thread[main,5,main] Create broker client for life-cycle management. Host:port = hikalxboes01:4001
1/13/12 10:57:47 PM Thread[main,5,main] Create broker client for data exchange with ASP. Host:port = hikalxboes01:4001. Client ID = com.acta.adapter.msexceladapter.MSExcelAdapter.data_18
1/13/12 10:57:47 PM Thread[Thread-11,5,main] Create broker client for real-time services with ASP. Host:port = 'hikalxboes01:4000''.
1/13/12 10:57:47 PM Thread[Thread-11,5,main] Start instance [BOExcelAdapter] of adapter [com.acta.adapter.msexceladapter.MSExcelAdapter].
1/13/12 10:57:47 PM Thread[Thread-11,5,main] Register the client ID [com.acta.adapter.msexceladapter.MSExcelAdapter.data_18] and adapter destination [hikalxboes01:4001] with the adapter manager.
1/13/12 10:57:47 PM Thread[Thread-11,5,main] Registration complete.
1/13/12 10:58:10 PM Thread[Thread-10,5,main] java.lang.OutOfMemoryError: Java heap space
at org.apache.poi.hssf.usermodel.HSSFRow.addCell(HSSFRow.java:273)
at org.apache.poi.hssf.usermodel.HSSFRow.createCellFromRecord(HSSFRow.java:196)
at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet(HSSFSheet.java:183)
at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:128)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:283)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:196)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:178)
at com.acta.adapter.msexceladapter.MSExcelAdapterReadTable.begin(MSExcelAdapterReadTable.java:537)
at com.acta.adapter.sdk.StreamOperationWrapper.beginStream(StreamOperationWrapper.java:88)
at com.acta.adapter.sdk.AdapterRunnerImpl.processBeginOperation(AdapterRunnerImpl.java:1762)
at com.acta.adapter.sdk.AdapterServiceDataListener.handleBrokerMessage(AdapterServiceDataListener.java:90)
at com.acta.brokerclient.BrokerClient.handleMessage(BrokerClient.java:439)
at com.acta.brokerclient.BrokerClient.access$100(BrokerClient.java:53)
at com.acta.brokerclient.BrokerClient$MessageHandler.run(BrokerClient.java:1621)
at com.acta.brokerclient.ThreadPool$PoolThread.run(ThreadPool.java:100)
BOExcelAdapter Error Log:
1/13/12 10:58:10 PM java.lang.OutOfMemoryError: Java heap space
at org.apache.poi.hssf.usermodel.HSSFRow.addCell(HSSFRow.java:273)
at org.apache.poi.hssf.usermodel.HSSFRow.createCellFromRecord(HSSFRow.java:196)
at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet(HSSFSheet.java:183)
at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:128)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:283)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:196)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:178)
at com.acta.adapter.msexceladapter.MSExcelAdapterReadTable.begin(MSExcelAdapterReadTable.java:537)
at com.acta.adapter.sdk.StreamOperationWrapper.beginStream(StreamOperationWrapper.java:88)
at com.acta.adapter.sdk.AdapterRunnerImpl.processBeginOperation(AdapterRunnerImpl.java:1762)
at com.acta.adapter.sdk.AdapterServiceDataListener.handleBrokerMessage(AdapterServiceDataListener.java:90)
at com.acta.brokerclient.BrokerClient.handleMessage(BrokerClient.java:439)
at com.acta.brokerclient.BrokerClient.access$100(BrokerClient.java:53)
at com.acta.brokerclient.BrokerClient$MessageHandler.run(BrokerClient.java:1621)
at com.acta.brokerclient.ThreadPool$PoolThread.run(ThreadPool.java:100)As Jay mentioned above it might be due to the size of the Excel spreadsheet as you might be hitting the limitation in Apache POI library used for adapter.
What is the size of the Excel file?
What is the value of -Xmx parameter - see DS Management Console > Adapter configuration page.
Thank you,
Viacheslav. -
How to take the data from excel list to sap r/3(with time interval)
hi experts,
how to transfer the data from a third party system(if it is in format of excel) to sap r/3.with that in a particular time interval,it will delete the data from excel sheet.Hi
use the Fm
'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_path
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '2'
i_end_row = '500'
giving the starting row and column and passing the ending row and column name
Reward points if useful........
Regards,
Nitin Sachdeva
Maybe you are looking for
-
I have Imovie HD 6 and Final Cut Express. I am creating the typical slideshow with photos from a digital camera and adding transitions and music, blah, blah. When I export in each application I get the same quicktime export screen. No matter what I d
-
What's the difference between "tar" command and ufsdump?
what's the difference between "tar" command and ufsdump?
-
Messages in Mavericks: How do we invoke "iChat Theater?"
Has the "iChat Theater" feature been removed from Messages? I can't find it anywhere. We used to be able to drag in files (video, pictures, documents) to view them "live" with our videoconferencing partner, like so: And now it appears that all we c
-
Menubar Icons disappearing/reappearing in a cycle
I have just installed Snow Leopard on a Macbook Pro. After installing I migrated my older macbook pro's data (also running Snow Leopard) using migration assistant from Time Machine. After migration had finished I started up the new MBP to discover th
-
CS5 Extended, update 12.01 issue
I just bought CS5 Extended (After returning regular, due to needing video support and Adobe broke that out after CS2) as an update to CS2. I had installed CS5 regular and update 12.01 and it was working (mostly anyway). I tried to install extended o