I would like to import an Excel .xls file workbook into Powerbuilder. The file has 2 sheets and these sheets must be imported into 2 differenct db tables.
Any assistance is kindly appreciated.
Thanks
John.
First thing, there's nothing automagic, along the lines of a one-line solution that you could get for other file formats. There's a manual method, there's a scripting approach, and you can probably merge the two as a third option.
For a manual method, you can go into Excel and export your data as something that will import into a DataWindow. You don't mention your PowerBuilder version, but the file format for importing from Excel that comes to mind is CSV, which was added in PB9.
For a scripting approach, you can use OLE (assuming Excel is installed on the client machine) and access data however you want with the scripting engine, moving it into PowerBuilder in whatever format you want.
To mix the methods, you could use OLE to export the file to a couple of CSVs, then dw.FileImport() the data in.
Good luck,
Terry.
Postscript: Sybase has examples of OLE access, and examples of using ODBC, a solution I had neglected before.
If you give names to the areas with the data in Excel and then setup ODBC connections that point to them, you can access them like a database table from within PowerBuilder.
Related
We have a screen which has number of fields from different tables, i need to extract those fields from tables and keep the data in Excel sheet. How can i do this ?
Is this a "one-time" data-transfer, or will it be an ongoing, automated process?
IMHO, for a "one-time" data-extraction, the easiest way to accomplish that is using ODBC. Historically, I've used ODBC to import the data into Microsoft Access. From there, it's extremely easy to export the data into Excel.
For a regularly-occurring, automated method, I think using the CpyToImpF command works the best. It takes a little trial-and-error to get the process working, but once you've got it set up, it can run in regularly scheduled job to export the data. (Google the syntax for the command, and try it yourself.)
HTH,
Dave
There is a tool called iEXL which will create .Xlsx spreadsheets native on the AS400.
If you after only data from one screen we will help you and the price would we adjusted to take this into account.
WWW.iEXLSOFTWARE.COM
Is it possible to run multiple PostgreSQL queries, and using pgadmin3 have them each export to a separate tab on a XLSX file?
On those same lines, is it possible to run one PostgresQL query that exports to multiple tabs based on some criteria?
You'll want to use an external tool for this. PostgreSQL knows nothing about the XLSX format, nor about OpenDocument or any of that.
I suggest writing a script that exports a bunch of individual CSV files with copy. Then using an external tool to convert them to xlsx and assemble them into sheets in the document.
It's possible that ETL tools like CloverETL, Pentaho Kettle, or Talend Studio may do what you want too. I haven't checked this specific functionality.
Is there a convenient, open-source method to generate a SAS XPORT Transport Format (xpt) file from a postgreSQL database for FDA submission?
I have checked the FDA specifications, available at http://www.fda.gov/downloads/ForIndustry/DataStandards/StudyDataStandards/UCM312964.pdf
These state that 'SAS XPORT transport files can be converted to various other formats using commercially available off the shelf software', but no software packages other than SAS are suggested.
The specifications for an SAS XPORT file are available at http://support.sas.com/techsup/technote/ts140.html
I have checked OpenClinica (which is the EDC software we are using), PGAdmin3 and AM (which can import .xpt files, but I didn't find an export method)
Easy way? Not that I know of. I think one way or another it will take some development work.
My recommendation is to do it as follows:
Write a user-defined function/stored procedure for pulling the data you need for each section.
Write a user-defined function to pull this data from each section and arrange it into an XML file. TheXML functions are likely to come in handy for this.
Of course you could also put the xml conversion in an arbitrary front-end. However, in general, you will find that the design above forces you to push everything into set-based logic which is likely to be more powerful in your case.
If you don't mind using Python, my XPORT module can write xpt files. https://github.com/selik/xport
If you have trouble using it, write me a note and I'll try to help. https://github.com/selik/xport/issues
I want to export my database tables to an Excel 2007 spreadsheet using servlets. Can anybody help me on this? I use Postgres SQL as back end.
You may be looking for an API to write MS Office files. Since you note servlets, I assume you are coding in Java.
i am using ADO.Net oledb for inserting and fetching data from Excel database. I want to make first column in the excel sheet to bold and i want to add comments. I am achieving this thru Interop.Excel Application class.
i dont want to use interop. is there anyway to achieve through ADO.net query itself ? or some other way? My application is c# windows application
No way through ADO.NET, any more than there is of making a SQL Server column bold. ADO.NET treats Excel as a data source - formatting is something quite different and requires knowledge of the Excel spreadsheet format, such as you'd get via Interop. There are probably other libraries you can use if you search...