importing excel file data to a datawindow

I'm trying to import data from an excel file that contains 20 columns and 
about 25 rows.  However, some of the columns contain alphabetic data that 
contains several lines of text.  Therefore, when I save the file as a tab 
delimited text file it causes problems when importing to the datawindow. 
The datawindow thinks that the column data, which gets word-wrapped, is 
several different records when in fact it is only one.  By the way I am 
using PB 5.

Gerald
0
Gerald
12/19/2001 8:49:54 PM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

2 Replies
5471 Views

Similar Articles

[PageSpeed] 54

Whenever I need to pull data from an Excel file I just use OLE to fire up
Excel, copy the data to the clipboard, and then copy that into the datawindow.
Try something like this:

string		ls_pathname, ls_filename
long			ll_rc
oleobject	loo_excel

IF GetFileOpenName ( "Open File", ls_pathname, ls_filename, "XLS", "Excel Files
(*.xls),*.xls" ) < 1 THEN Return

loo_excel = CREATE OLEObject
loo_excel.ConnectToNewObject( "excel.application" )
loo_excel.visible = false
loo_excel.workbooks.open( ls_pathname )
loo_excel.ActiveCell.CurrentRegion.Select()
loo_excel.Selection.Copy()
ll_rc = dw_1.ImportClipBoard ( 2 )
ClipBoard('')
loo_excel.workbooks.close()
loo_excel.disconnectobject()
DESTROY loo_excel

On Wed, 19 Dec 2001 15:49:54 -0500,
 in powersoft.public.powerbuilder.general
 <Gerald> wrote: 
>I'm trying to import data from an excel file that contains 20 columns and 
>about 25 rows.  However, some of the columns contain alphabetic data that 
>contains several lines of text.  Therefore, when I save the file as a tab 
>delimited text file it causes problems when importing to the datawindow. 
>The datawindow thinks that the column data, which gets word-wrapped, is 
>several different records when in fact it is only one.  By the way I am 
>using PB 5.
>
>Gerald

Bruce Armstrong [TeamSybase]
http://www.needhim.org

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp
0
Bruce
12/21/2001 12:19:38 AM
To read Excel, I often use ODBC.  Define a named range with the first row
containing the column headers (use UPPERCASE).  Then define an Excel DSN
using MS or PB/Intersolv driver.

--
Terry Dykstra (TeamSybase)
Please state PB / OS / DB versions in your post.
MySybase http://my.sybase.com/mysybase
Search Deja: http://www.pfcguide.com/_newsgroups/search.asp

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
wrote in message news:AycctUbiBHA.375@forums.sybase.com...
> Whenever I need to pull data from an Excel file I just use OLE to fire up
> Excel, copy the data to the clipboard, and then copy that into the
datawindow.
> Try something like this:
>
> string ls_pathname, ls_filename
> long ll_rc
> oleobject loo_excel
>
> IF GetFileOpenName ( "Open File", ls_pathname, ls_filename, "XLS", "Excel
Files
> (*.xls),*.xls" ) < 1 THEN Return
>
> loo_excel = CREATE OLEObject
> loo_excel.ConnectToNewObject( "excel.application" )
> loo_excel.visible = false
> loo_excel.workbooks.open( ls_pathname )
> loo_excel.ActiveCell.CurrentRegion.Select()
> loo_excel.Selection.Copy()
> ll_rc = dw_1.ImportClipBoard ( 2 )
> ClipBoard('')
> loo_excel.workbooks.close()
> loo_excel.disconnectobject()
> DESTROY loo_excel
>
> On Wed, 19 Dec 2001 15:49:54 -0500,
>  in powersoft.public.powerbuilder.general
>  <Gerald> wrote:
> >I'm trying to import data from an excel file that contains 20 columns and
> >about 25 rows.  However, some of the columns contain alphabetic data that
> >contains several lines of text.  Therefore, when I save the file as a tab
> >delimited text file it causes problems when importing to the datawindow.
> >The datawindow thinks that the column data, which gets word-wrapped, is
> >several different records when in fact it is only one.  By the way I am
> >using PB 5.
> >
> >Gerald
>
> Bruce Armstrong [TeamSybase]
> http://www.needhim.org
>
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.pfcguide.com/_newsgroups/group_list.asp


0
Terry
12/24/2001 4:35:01 PM
Reply:

Similar Artilces:

Import data into a DataWindow from an Excel file.
Hi, I need to import data into a DataWindow (PB 8) from an Excel file. The data is in tabular format with the first row as column names. I would prefer not to use the Excel file as a database but to use an order like ImportFile. The user has to choose the file and then it has to be read into the DataWindow. Thank you in advance. Mart=edn. Hi Martin, If you name the area in Excel, you'll be able to access it via ODBC, Otherwise you can connect through OLE....and then access data directly, or export it to something you can import to DW. Regards Martin gid pisze: > H...

Importing data from either Excel Files or CSV files
Hi, I am having trouble uploading data from Excel/CSV files.  Any idea how I can get my ASP.NET application to do this?  Also, I need to transfer the data into SQL Server tables.  Any suggestion is greatly appreciated.  Thank you, Jules  this link help youhttp://www.codeproject.com/cs/database/CsvReader.asp  Try this one... its a good option http://www.codeproject.com/cs/database/FinalCSVReader.asp Thank you Bupender Thanks chrisjob012!  Mark as answer if reply helped you  this gives us the confident to reply further I am new to progra...

How to Import data from Excel file
Hi all How to import the data from excel file to datastore or datawindow during the runtime without using the DDE function. I am using PB9. Thanks in advance Regards Shivkumar K Datawindow pipeline comes to mind. "Shivkumar K" <shiv@cgvakindia.com> wrote in message news:42789ebd@forums-1-dub... > Hi all > > How to import the data from excel file to datastore or datawindow during > the > runtime without using > the DDE function. > > > I am using PB9. > > Thanks in advance > > Regards > Shivk...

importing excel data into a datawindow
I'm trying to import data from an excel file that contains 20 columns and about 25 rows. However, some of the columns contain alphabetic data that contains several lines of text. Therefore, when I save the file as a tab delimited text file it causes problems when importing to the datawindow. The datawindow thinks that the column data, which gets word-wrapped, is several different records when in fact it is only one. By the way I am using PB 5. Gerald PB looks for tabs and CRs. It shouldn't care about wrapping, which is just a visual feature of an editor anyway. On wr...

Import excel file into datawindow
Hi to all , How can i import excel file into datawindow ? My application expect only to *.xls file and not to *.txt file thanks david. use the odbc driver for excel <David> wrote in message news:44f14e06.1f22.1681692777@sybase.com... > Hi to all , > How can i import excel file into datawindow ? > My application expect only to *.xls file and not to *.txt > file > > thanks > david. ...

Import Data from an Excel file
Dear all, Can you tell me how to import data from an excel file into a datawindow? Thanks.. Lots of options: You can use OLE. Another option is to define an ODBC DSN. (Basically requires that you have a named range in the spreadsheet that becomes the tablename). Save as csv and then use dw importstring. -- Terry Dykstra (TeamSybase) http://powerbuilder.codeXchange.sybase.com/ http://www.pb9books.com product enhancement requests: http://my.isug.com/cgi-bin/1/c/submit_enhancement <KK> wrote in message news:44910c22.9a4.1681692777@sybase.com... > Dear all, > ...

How to import data from excel file?
Hi I want to import the data from excel file in to datawindow or datastore. How to do this ? or How to open the excel file and read the content cell by cell of all rows TIA Save XLS as Tab delimited file and use ImportFile function. Use Import..(from menu) or PipeLine control. -- Max (m_pavlov@mail.ru) -- "ewak" <ewak@vsnl.com> �������/�������� � �������� ���������: news:nLzZoNiqBHA.206@forums.sybase.com... > Hi > > I want to import the data from excel file in to datawindow or datastore. > How to do this ? > > or > > H...

How to import Excel file to datawindow?
The way we are doing this is using OLE with EXCEL to save the file as tab delimited text file and then import that text file into Datawindow. User simply selected EXCEL file for import and never knows what is being done behind the scene. Another option is to define an ODBC Excel DSN. You need to setup a Named Range in Excel with the first row containing column headers. -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. Techwave 20002 www.sybase.com/techwave2002 Session E179 - Advanced Infomaker with Help of its Friend PowerBuilder <SAIYED&...

Import Excel file in datawindow
open datawindow at runtime and save data in Excel file then update that Excel file, Now I want to import Excel file into datawindow then update oracle database .So anybody have clue please send me email. thanks Hi, Have you try dwcontrol.ImportFile ( filename {, startrow {, endrow {, startcolumn {, endcolumn {, dwstartcolumn } } } } } ) Regards Fred kamlesh Patel a �crit dans le message <35E1A2BF.539A92AF@hotmail.com>... >open datawindow at runtime and save data in Excel file then update that >Excel file, Now I want to import Excel file into datawindow th...

Import data from a Excel File
Hello, I want to import data from a excel File into Sybase. So I use the following sql input into tb_tst from 'c:\\kero4.xls' format EXCEL; SQL Tells me that there is a error in line 34. When I tell I want to continue I have a count of 75 and not 101 as there are 101 records im my excel file. Could you please tell me what is wrong with the file (as every column is Text all should work) I saw that when I have non integer values in the column E, F, G.... I have this error. have a non integer values in column D I have no error I saw that the column E F G... are conve...

import data through excel file
  hii all,         i've to import bulk data from excel file to sql server 2000 , i'm using asp.net 1.1 with C# and i've to make a front end(windows application) for this. help me out if any1 knows that... Thanks & Regards anant vijay u can use bulk insert.Plz check these linkshttp://www.thescripts.com/forum/thread246959.htmlhttp://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic16463.aspxhttp://weblogs.sqlteam.com/mladenp/archive/2006/08/26/11368.aspxThank uBabaPlease remember to click "Mark as Answ...

Importing Data From an Excel file
Anybody know how I could import data from an Excel sheet into a dataset via ASP.NET using VB.NET? Here is the code I have that works with a win32 app. It gives me a COM error. The Excel.dll, Interopp.dll, and Office.dll are all on the webserver. Dim strfile As String = "E:\Sites\InsuranceTmeplateSite\tempProcess\" & Now.Ticks.ToString() & ".XLS" File1.PostedFile.SaveAs(strfile) Dim EXL As New Excel.Application Dim wsheet As Excel.Worksheet wsheet = EXL.Workbooks.Open(strfile).Worksheets.Item(0) Dim tb As New DataTable Dim ds As New DataSet Dim cl1 As New DataColumn("Name") D...

Import Data From Excel to Datawindow
Hi there I'm using Powerbuilder Ver. 9 I want to import data from excel sheet to datawindow at run time by creating the datawindow depending on excel cells for the column name and data type Could any one help me how can i do it thanks alot With my best regards Ahmad Alhowaimel You can create an ODBC profile that uses your Excel spreadsheet as the "database". Once that is created, PowerBuilder sees it as just another database connection, and you can create datawindows using that datasource. Paul Horan[TeamSybase] <Ahmad Alhowaimel> wrote in message ...

importing an excel file into a datawindow
hello everybody I am trying to import an excel file into a datawindow(like a text file). Is there any method or work around to achieve this. An alternate which i thought was using oleobject, opening the excel file and using SaveAs to save into a text file for import into a datawindow.for this I can't find any method to open an excel file through OLEOBJECT. Thank in advance Magesh Babu.V This script will open a particular excel file // Create the oleobject variable xlapp xlApp = Create OLEObject // Connect to Excel and check the return code ret = xlApp.ConnectTo...

Web resources about - importing excel file data to a datawindow - sybase.powerbuilder.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Intelligent Versus Surrogate Keys
Should I use business columns as primary key fields for tables in thedatabase, or generate artificial primary key values? When business-related ...

chevy volt
ProEXR File Description =Attributes= channels (chlist) compression (compression): Zip dataWindow (box2i): [0, 0, 5119, 2475] displayWindow (box2i): ...

Enable - A comprehensive solution for the localization of PowerBuilder applications Untitled Document ...
Enable is localization/ translation tool used by PowerBuilder developers to make their applications multilingual.Enable is a powerful tool that ...

comp.lang.clipper.visual-objects - Google Groups
comp.lang.clipper.visual-objects 1-20 von 33006 Themen werden angezeigt Integrity of a file marcosm...@gmail.com 09:35 Combobox value Lu 08:12 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
Developers can choose Win32 or newer style .Net development

PowerToTheBuilder - PowerBuilder UI Controls
HOME - COMPONENTS - PB UI DESIGNER - DOWNLOAD\PURCHASE - SUPPORT - FAQ - ABOUT Take Control of your UI with PB Ultimate Suite PowerToTheBuilder.com ...

Beautiful iPad Mini 3 Concept Reimagines Apple’s Tablet With iPhone 6 Design, Gold Color [Images]
The iPhone 6 may be grabbing all of the recent headlines due to its impending announcement, but spare a thought for those who prefer to stay ...

Java Networking - Real's HowTo
Real's HowTo Custom Search Java Language String and Number Applet AWT Swing Environment IO Javascript interaction JDBC Thread Networking JSP ...

Business Intelligence Products - Database Management, Data Warehousing & Mobility Software - Sybase Inc ...
Sybase offers a variety of Business Intelligence (BI) software like products for database management, data warehousing and mining, data integration ...

Resources last updated: 1/21/2016 6:10:11 AM