How to extract data from .xltm file in a (dataset, datatable or a list) using wpf c#
Hi all,
As we can get data from .xls, .xlsx file in a dataset. Now i want to read all the entire data from .xltm file.
I also want to get all sheets name from .xltm file. I am using .Net framework 4.5, Visual studio 2012.
Please help me. I am unable to extract it. It is urgent.
Hello Kalpna Bindal,
I just investigate this issue and use the following way but it does work:
private void Button_Click(object sender, RoutedEventArgs e)
// initialize connection
OleDbConnection con = new OleDbConnection();
con.ConnectionString =
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\Fruits1.xltm;Extended Properties=\"Excel 12.0 Xml;HDR=YES;\"";
//pass query to Insert values into Excel
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "insert into [Sheet1$] values('')";
cmd.Connection = con;
// EXECUTE QUERY
con.Open();
cmd.ExecuteNonQuery();
con.Close();
I then did a research about this issue and find the following case:
http://stackoverflow.com/questions/22225017/reading-excel-xltm-files-programmatically
To test whether it is possible I use the following code in WPF:
Microsoft.Office.Interop.Excel.Application xltmApp = new Microsoft.Office.Interop.Excel.Application();
xltmApp.Visible = false;
xltmApp.ScreenUpdating = false;
Workbook xltmBook = xltmApp.Workbooks.Open(@"D:\Fruits1.xltm");
Worksheet xlworksheet = xltmBook.Worksheets.get_Item(1);
for (int i = 1; i <= 1; i++)
for(int j=1;j<=1;j++)
string str = (string)(xlworksheet.UsedRange.Cells[i, j] as Microsoft.Office.Interop.Excel.Range).Value;
MessageBox.Show(str);
The result is that I can read this .xltm file and read the firstline without problem.
I would think you can also use this way to work with your .xltm file and output it to your application.
For more details about how to fill to your WPF, common wpf and excel thread will be helpful:
http://www.codearsenal.net/2012/06/c-sharp-read-excel-and-show-in-wpf.html#.URPyfPJJocU
http://www.dotnetcurry.com/showarticle.aspx?ID=988
http://mozouna.com/Blog/2013/03/28/wpf-reading-and-writing-to-excel-file-with-c/
By the way, for WPF case please post on WPF forum instead of C# forum.Best regards,
Barry
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.
Similar Messages
-
How to extract data from XML file with JavaScript
HI All
I am new to this group.
Can anybody help me regarding XML.
I want to know How to extract data from XML file with JavaScript.
And also how to use API for XML
regards
NagarajuThis is a Java forum.
JavaScript is something entirely different than Java, even though the names are similar.
Try another website with forums about JavaScript.
For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3 -
How to extract data from xml file and store that data inti data base table
Hii All
I have one table that table contains one column that column contain an XML file
I want to extract data from that XML file and want to store that extracted data into an other table.
That xml file has different different values
I want to store that values into table in diff diff columnsHi,
I am also facing the same problem.I have a .xml file and i need to import the data into the custom table in oracle database.
Can you please let me know if you know the solution how to do it in oracle apps.
Thanks, -
How to extract data from xml file in owb 10.2?
I have to load data from an xml file into a relational table , may i know how to do it in owb 10.2.
This is a Java forum.
JavaScript is something entirely different than Java, even though the names are similar.
Try another website with forums about JavaScript.
For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3 -
How to extract data from text file to database table
Hi ,
I am trying to upload data in text file to database table using GUI_UPLOAD function .what would be the program for that.
thanks in advance.Hi,
I don't think you have a standard sap program to upload data from file to database table...
Instead you can create a custom program like this..
DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
tables
data_tab = T_FILEDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT T_FILEDATA.
T_ZTABLE = T_FILEDATA.
APPEND T_ZTABLE.
ENDLOOP.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
COMMIT WORK..
Thanks,
Naren -
How to extract data from dmp file to oracle express edition database
Hi,
I wanted to extract a oracle dump file in oracle express edition database. Is it possible? If yes, then can anyone please guide me how to do it?
ThanksHi,
This might help
Backup/Export Question!
Br,Jari -
How to extract data from a file?
o to all labview users.
I am currently learning labview to control the network analyzer hp8720
as part of my project. Through my program, i am able to do a sweeping
function with my NA and the sweeping data are written to txt file. and
i want to extract the db value corresponding to a specific frequency.
my txt file is like the following:
MHz dB
103 0.015
168 2.09
201 2.67e01
I know that we can extract certain selected data by using the some palettes like "read file" and "scan file"
I tried using "scan file" and i couldnt extract the data(ex: the dB
value corresponding to 168MHz) i want successfully....i checked the
help file and did put some syntax in the format string like (%[^2.09]),
but it seems the "scan file" palette was only able to scan the first
line, which gave me "Mhz db".....
is the format of my txt file not correct?
also, i tried using "read file" palettle..and i set the count to "-1"
to read the whole file. someone suggested on the forum that it is
easier to read the whole file and then use array to extract the
selected data.
How can i write to the array using "read file" while specifying the what range of data i want?
Instead of doing that, maybe i can just simply write the db value
related to the specific range of frequency while the program is in a
while loop doing sweeping?
It would be greatly appreciated if someone could me some guidance.
thank you very much
Happy guy
~ currently final year undergraduate in Electrical Engr. Graduating soon! Yes!
~ currently looking for jobs : any position related to engineering, labview, programming, tech support would be great.
~ humber learner of LabVIEW lvl: beginner-intermediateHi, I have been reading this post It is very interesting and also I
need help. I am doing a project involving scattering matrix (S
parameter) using frequency and time domain analysis. In order to make
use of S parameter in frequency domain from Vector Network Analyzer, I
need to convert S parameters from frequency domain (sweep from 8.2 GHz
to 12.4 GHz) to time domain using inverse chirp z transform or any. I
have no idea how to implement it. Could you please help or guide me how
to implement them. I am using Labview 8.0 and matlab. Please see the attached file for the data in frequency domain both linear , dB magnitude and phase.
Thank you so much for any help.
Tantong
Attachments:
S11 Phase.xls 70 KB
S11 dB magnitude.xls 70 KB
S11 linear magnitude.xls 70 KB -
Extract data from XML file to Oracle database
Dear All
Please let me know, how to extract data from XML file to Oracle database which includes texts & images.
Thanking You
Regards Lakmal MarasingheI would do it from the database, but then again, I am a database / PL/SQL guy.
IMHO the database will deliver you with more options. I don't know about "speed" between the two. -
JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC
Hi,
I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
Regards
KumarHI,
Yes it can be possible ,please see the following links
JDBC Receiver with Oracle Stored Procedures
configuring jdbc adapter with multiple tables
RFC -> XI -> JDBC Scenario Updating Multiple Tables
/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
JDBC Adapter multiple Selects
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
Regards
Chilla.. -
How to extract data from Essbase to Flat File using ODI
Hi,
Anyone know how to extract data from Essbase to Flat File using ODI?
Thanks in advance.
Regards,
SumardiHi,
Have you read through :-
Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
If you have read them and are still have a problem at what stage are you having the issues?
Cheers
John
http://john-goodwin.blogspot.com/ -
How to extract data From Hyperion Essbase to Flat Files
Hi ,
Can anyone tell me how to extract data from Hyperion essbase to Flat file(e.g. .csv , .txt ,...) or Oracle Table using ODI.
Regards,
AvneetHi sutirtha,
I have make one column as key column now i am getting this error,
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 1, in ?
com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at com.hyperion.odi.essbase.ODIEssbaseDataReader.getAppData(Unknown Source)
at com.hyperion.odi.essbase.AbstractEssbaseReader.extract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyInstance.invoke(PyInstance.java)
at org.python.pycode._pyx7.f$0(<string>:1)
at org.python.pycode._pyx7.call_function(<string>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.k(e.java)
at com.sunopsis.dwg.cmd.g.A(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
Caused by: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.validateColumns(Unknown Source)
at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.init(Unknown Source)
... 33 more
com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.k(e.java)
at com.sunopsis.dwg.cmd.g.A(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source) -
How to extract data from SAP in FDM 11121
I came across some documents from version 11113, says there is a SAP adapter, however ,when I check 11121 there's no such adapter, does anyone know how to extract data from SAP in FDM 11121?
I download a package from Bristlecone, but I dont see any xml files in it, just a bunch of dll and I didn't find any instructions on how to set up/configure in FDM, it just explained how to register in SAP app server and client.
Hyperion 11113 has readme on sap adapter(Hyperion Readme Template), but I cannot find the same readme file in 11121, all I can find is ERP Integration Adapter document. any idears where I can find at least a readme document? -
How to extract data from Chart History?
Dear all, I have read a lot of posts, but still don't understand how to extract data from Chart history.
Suppose you acquired 1024 points of data every time, then use "build array" to build an array, then send to intensity chart to show, then save the history into a .txt file, but how to extact data from the file?
How Labview store the data in the 2D history buffer?
Anybody has any examples?The simplest would be to save the 2D array as a spreadsheet file, the read it back the same way.
Maybe the attached simple example can give you some ideas (LabVIEW 7.1). Just run it. At any time, press "write to file". At any later time, you can read the save data into the second history chart.
If you are worried about performance, it might be better to use binary files, but it will be a little more complicated. See how far you get.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
IntensityChartHistorySave.vi 79 KB -
How to extract data from ODS to non-SAP system
Hi,
Can anybody tell me, step by step, how to extract data from ODS to a non-SAP system?
Is it possible to do it without programming effort? And is there volume limits for this kind of extraction?
The non-SAP system is an unix system.
Thanks in advance
EllaElla,
You can look at it from the concept of a BADI / Infospoke
Extract the data from the ODS to a Flat file / RDBMS using an infospoke. I am not sure as to how the infospoke loads data into the RDBMS ( did it very long ago ) but then you can push it into an RDBMS and I am sure it will be system neutral.
Hope this helps...
Arun
Assign points if it helps -
Hi, extract data from xml file and insert into another exiting xml file
i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
1st xml file which has two lines(text1.xml)
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
<xs:Person>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
Regards,
bubblyJadz_Core wrote:
RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.
Maybe you are looking for
-
Error Deleting/Archiving processed files
Hi all, I'm working with a File (xml) to Idoc scenario. I have configured Sender File Channel to read files and after that deleting . SAP XI can read the files (xml files) and send to my SAP R/3 system but I in communication channel monitoring I get
-
Hello, just to explain quikly how my situation is I bought an IPhone and connected it to my regular computer, a few weeks after that i bought an macbook because my old computer was having problems with all kinds of things. recently my old computer "d
-
Apple replacement unlocking question
I recently got given a replacement phone from Apple for one that had a smashed screen and decided that I would give this to my partner as a gift. However, she is on a different network than me and even though I thought all Apple iPhone's were unlock
-
BBC One Highlights page not displaying content of its panes
Why does the BBC One Highlights page not display the content of its panes?
-
Hey! While learning various linux tools in the past, I made several cheat sheets to speed up the learning process. Recently I decided to put them on my blog. Here is a link to all the cheat sheets on my blog: cheat sheets at catonmat (my blog) They i