单独运行"write data to excel.vi"时没问题,调用时出现错误?(求教Yukee,鬼)
¤╭⌒╮ ╭⌒⌒╮
╱-◥██◣ ╭ ╭
︱田︱田田|
Mail:[email protected]
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
附件:
excel t2.vi 17 KB
你的程序没有错误,运行出错的原因在于你的输入的表格为空,行标和列表也是空的。这样for循环实际上就1次都没有运行,所以无法把worksheet的参考号传递下去。解决的方法很简单,初始化一下你的table,使它非空表格。见附件。
Lady And Basketball Vividly In my Exciting World !!!
Daniel.Tang E-mail: [email protected]
附件:
excel t2.vi 33 KB
Similar Messages
-
Dear all,
I would like to write data to excel template using POI. What can I do? Please help me. Thank a lot!
Regards,
kzyoToday's mantra is: "google is our friend"
Repeat that to yourself several times as you exhale slowly. Through mediation, a solution to your problem will come to you. -
How to Write data in Excel File using java
Hi
can anybody help me to write data in excel file
using java code
Thankx In AdvanceHow much are you willing to pay for that?
If you want it for free, http://jexcelapi.sourceforge.net/ -
How to read and write data from Excel to TestStand without using LabVIEW VIs
Hi,
How can I read in columns of data from Excel into a TestStand array and write columns of data to Excel from TestStand without using LabVIEW VIs?
I don't think the Property Loader custom step type in TestStand will work because the data I would like to read in from Excel is in a column that is thousands of rows long and the data has to be in the proper format to use the Property Loader to load in an array from Excel.
Thanks for your help.That example does not use LabVIEW and it does about 40% of what you need to do by calling Excel through ActiveX. If you don't know how to use Excel through ActiveX then you'll need to brush up on that.
http://www.microsoft.com/en-us/download/details.aspx?id=16250
http://support.microsoft.com/kb/141759
http://support.microsoft.com/kb/302084
CTA, CLA, MTFBWY -
I want to write data from oracle table to Excel sheet in formated way like bold or merge the cell in case of same value.
Edited by: shiv kumar on Jul 27, 2010 10:18 AMRead Suns JDBC Tutorial, then if there is already an Excel spreadsheet set up to use as an ODBC datasource use JDBC and the JDBC/ODBC bridge. If there is not an already setup ODBC Datasource then Google POI HSSF and/or JExcel to do the Excel part.
-
Unable to write data into excel file when it's close
Hi,
I'm facing this problem and it's a bit weird. I'm using the following method to insert data into excel file. But when excel file is close, it unable to write data into the excel sheet. But it was able to write the data into the excel sheet if i open the excel file when running the program.
Can anyone please tell me what's wrong to the code?
public int updateLog(String sheet, String no, String cpId, String CatId, String rbtCode, String rbt, String rbtName, String artistName, String price, String rbtFileName, String songId, String msg){
int result = -1;
try{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.ENGLISH);
String actionDate = formatter.format(new Date());
rbtName = rbtName.replaceAll("'", "''");
artistName = artistName.replaceAll("'", "");
String sql = "insert into [Sheet3$] (Code, CpID, CategoryID, RBTCode, RBT, RBTName, ArtistName, Price, RBTFileName, SongID, UploadStatus, FileUploadedDateTime) ";
sql = sql + " values ('" + no + "', '" + cpId + "', '" + CatId + "', '" + rbtCode + "', '" + rbt + "', '" + rbtName + "', '" + artistName + "', '" + price + "', '" + rbtFileName + "', '" + songId + "', '" + msg + "', '" + actionDate + "')";
System.out.println(sql);
log.writeLog(sql);
result = stmnt.executeUpdate(sql);
} catch(Exception e){
e.printStackTrace();
log.printStackTrace(e);
return result;
public int openConnection(){
int result = -1;
try{
Class.forName(dbDriver);
c = DriverManager.getConnection(conStr + excelFilePath+";ReadOnly=0;");
stmnt = c.createStatement();
} catch(Exception e){
e.printStackTrace();
log.printStackTrace(e);
return -1;
return 1;
}ThanksHI,
i hv a doubt regarding reading / opening of a
password protected Excel file using jxl( java ) .
How to read / open a password protected Excel file
thro Java (jxl ) program .plz let me know some
example also .
Regards,
Ramesh P
845935822cross posting !! answered here
http://forum.java.sun.com/thread.jspa?threadID=710466&messageID=9507085#9507085 -
Facing problem in writing data to excel sheet using ActiveX
Hi.
I want to write data from a one dimesional array to a particular excel sheet in a particular row.Please see the attached vi for explantion.
It is giving error.But If I give a new file name when the appliation is getting closed it is writing data to the new excel file.
Please help.
Thanks in advance
Attachments:
Excel sheetWrite.vi 90 KBThanks Jhoskin and Rudi .......
I am able to write data to excel sheet now. I am attaching one"test.zip" file that contains a VI named "Squence.vi "that contains another subVI named "Write U94006 Table To XL.vi"which does the functionality of counting the number of rows in the excel sheet and writing data in the next blank row. I am using the same subVI in the VI named "Sequence.vi"two times so it is taking a lot of time in opening and closing the excel sheet. Will you please suggest some way of calling the subVI only one time.
Rikki
Attachments:
Test.zip 105 KB -
Problem in writing data to excel spread sheet
Hi Folks,
I have developed a jdbc application that writes data to excel spread sheet.while trying to write data to excel, it could not write date values properly.it is writing 00.00.0 for all the date feilds.
Can some one help here.
Thanks in advance.You can try VistaJDBC at http://www.easyhr.com.au/software/easy_mdb_mde_compactor.htm .
Otherwise you can write your code to csv/xml/dbase III format, since Excel can open those file format easily. -
Downloading data in excel sheet
Hi All,
I want to download data in excel sheet. My requirment is to use the same excle sheet to fill data.
The next data should be entered in the column of the excel sheet. Is there a possible to write data in excel sheet at a particular row/column.
Please let me know if this can be achevied?
For Ex:
Data: 10, 20, 30
Excel sheet:
10
20
30
Data: 40, 50, 60
Excel sheet:
10 40
20 50
30 60
Thanks & Regards,
Rupali RayHi,
This should be possible by OLE concept.
Have a look at report RSDEMO01
Regards -
What is the best way to send Time vs Temp data from a thermocouple measurement to excel? I have included my set-up if that will help. Thanks in advance for your help and advice.
Kenny
Attachments:
Final-Thermocouple2.vi 87 KBFor information on how to write data to excel, check out the examples that ship with LV. Then get back with us if you have additional questions.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Writting in MS Excel which containing no sheet
I am developing application for the taxation purpose . I have an excel workbook which is macro enabled , but there is not any worksheet . This is provided by Government of India for vat return etc . How can i write data in excel workbook without containing sheet name . I need urgent. Please help as soon as possible.
Download excel book to check : http://www.eultimateinc.com/xls/Yes , it contains cell where we will fill by simple text without any formula. But it's not showing any sheet.It is micro enabled workbook.
I used code as
Following xls workbook provided by Government Of India for there taxation purposes
*[special xls file to use |http://www.eultimateinc.com/xls/PVAT-24.xls] http://www.eultimateinc.com/xls/PVAT-24.xls*
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class NewClass {
public static Connection getConnection() throws Exception {
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=PVAT-24.xls;"
+ "DriverID=22;READONLY=false";
String username = "";
String password = "";
Class.forName(driver); // load JDBC-ODBC driver
return DriverManager.getConnection(url, username, password);
public static void main(String args[]) throws Exception {
Connection conn = null;
Statement stmt = null;
conn = getConnection();
stmt = conn.createStatement();
String excelQuery = "insert into [Sheet1$] values('Abc inc.') ";
stmt.executeUpdate(excelQuery);
stmt.close();
conn.close();
I got an error
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Excel Driver] 'Sheet1$' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not 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.SQLExecDirect(JdbcOdbc.java:3110)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
at NewClass.main(NewClass.java:35)
Java Result: 1Please help to resolve this . Thanx. -
How to write more than 65536 data in excel Via Labview in one column
I have more than 65536 data and i want to write these data in excel sheet. It is giving Error:-
"Description:-
Error -2146827284 occurred at an unidentified location
This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input."
Less than 65536 data can be written....
Please give some solution...This is not a limitation of LabVIEW writing to a spreadsheet file but a limitation of Microsoft Excel (and also of Notepad) itself.
One option could be, you can switch to Excel 2007 or higher verison...!!
Other solution could be, forget about writing to Excel, instead write in some other format and use LabVIEW your other compatible (with large data) application to read it back.
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT. -
Read data from Excel and write into oracle database
Hi
I want to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
Thanks and Regards
NeetaHai,
I am suggesting the solution.
I will try out and let u know soon.
Make a coma separated file from your excel file.
Assuming that your requirement allows to make a csv file.
This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
You do not want to go via sql Loader?
For reading the excel file itself do you want java? -
Write data of a table to an excel sheet
Hi
How i can write data of a table to an excel sheet?
regard
deemySearch this forum for 1.2 Jiga-examples...
-
How to write data/result in excel or external data source in c#??
Hello Team,
I have automation framework in c#. So there are multiple testmethod and testclasses.....so i havt to write result of every testmethod ...in below format..in excel
[TestMethod]
public void Demo()
WriteIntoExcel("TestClassName","TestmethodName", Pass/Fail, Time);
I can all info in every methods but i dont know how to write it in excel or any other external datasource after every method .....
Actually i want c# code to which will write data/result in excel ...excel might be saved in shared drive...
Thanks in advanceHi Mon,
We also could use OleDbConnection to insert data into excel.
using System.Data.OleDb;
using Excel = Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop;
//in the method section use as :
string datevariable = "02/02/2010";
string namevariable = "Shyam";
string strConnectionString ="";
string cmd;
string filepath = ""C:\\sample.xls";
strConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+filePath+@";Extended Properties=""Excel 8.0;HDR=Yes;""" ;
OleDbConnection conn =new OleDbConnection (strConnectionString);
try
conn.Open();
catch(Exception e)
Console.WriteLine(e);
try
// Insert into Sheetname
cmd = "Insert into [Sheet1$] ( [Date], [Name]) values ('" +datevariable+ "','" +namevariable+ "');
//Similarly you can update also
OleDbCommand cmdUpd=new OleDbCommand(cmd);
cmdUpd.Connection = conn;
cmdUpd.ExecuteNonQuery();
conn.Close();
catch(Exception e)
Console.WriteLine(e);
Best regards,
Kristin
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.
Maybe you are looking for
-
Is ios 5.1.1 the latest update for my original ipad
Many of the latest apps require ios 6 or newer but everytime I check to see if the later versions are available all I get is my ipad is up to date version ios 5.1.1. Is this it for the original ipad are we being forced to get newer gadgets in order f
-
Hi, first time poster here...just recently got into timelapse photography and have been batch processing away to my hearts content. I have one scene that looks unbelievable with the "surrealistic" HDR toning preset. However, I record my action and se
-
i have a scene in my flash movie that contains photos and sounds... i want to design a preloader (a progress bar) in another scene or in the same scene(using another frame) that shows the download progress of the scene. I know how to design a progres
-
Itunes can't find alot of my music.....
I don't know what happen but oneday all my music or atleast the majority of them itunes can't find in my harddrive the names of all the song are in the library but once i click on them it take me to this screen where i have to search for them and the
-
Starting and stopping SAP in Unix
Hi, Pls tell me the command to start and stop sap in Unix. I dont want to start and stop the Database Pls help