I have a datawindow that I need to save to Excel. The dw has 2 date columns, but when I do a Save Rows As and save it to excel it puts these date columns to TEXT and I am not able to sort or format them in excel. Is there any other way to do this?
That doesn't seem to work. The user is wanting to be able to sort the spreadsheet by any columns once she has it saved to Excel. She can sort it by date within powerbuilder and then save it to Excel...but once in excel she can't resort by something else and date.
I am having the same problem with dates in Excel.
Have you been able to solve it?
I am saving dw with dates to Excel file. After it is saved, the user can not sort data by that column. The reason is : date format from sybase "mm-dd-yyyy hh:mm:ss".
I was able to find a solution in Excel itself:
Use replace function to replace "00:00:00" with " ". In this case the time and the single quote in the beginning of the date dissapear, which makes the field sortable.
Now I am trying to automate it in PB.
I save the data in Excel format and the open it thru OLE.
However I can not find solution for using vb "Replace" function in pb code. It gives me errors.
I ran into this issue once. Try just using the saveasascii function to save your datawindow and import it into excel and if necessary you can open it thru pb using the excel ole and do any formatting (column widths etc..)
When I was trying to export to Excel, I tried saving as all different types and I think saveasascii ended up working best for me, although I had to do some extra formatting on the file through the OLE to make it look good.
In reguard to your renaming issue, you could use the pb filemove function but remember, simply renaming the file (file.txt -> file.xls) only changes the name (and what it opens with by defaul) not the actual type. (Just because it says '.xls' doesn't mean it's a true Excel doc.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.