| View previous topic :: View next topic |
| Author |
Message |
Dhanil Shah Guest
|
Posted: Wed Apr 07, 2004 10:49 pm Post subject: How to remove" ' " sign from cell (Visual FoxPro) |
|
|
Hello,
We have one application in Foxpro that generates .xls file. This file gets open perfectly in Openoffice.org file. But in this file one of the column is date. In date, it prefix " ' " sign sothat it is not able to show date as Date Formate i.e. it accepts it as a Text.
If I press F2 to edit cell & remove " ' " sign than it shows in date format. So I want to know how to remove " ' " sign from each cell in column that has date but not shown as Date format.
Please help me...
Dhanil Shah |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Apr 08, 2004 5:14 am Post subject: Re: How to remove" ' " sign from a cell |
|
|
| Dhanil Shah wrote: | Hello,
We have one application in Foxpro that generates .xls file. This file gets open perfectly in Openoffice.org file. But in this file one of the column is date. In date, it prefix " ' " sign sothat it is not able to show date as Date Formate i.e. it accepts it as a Text.
If I press F2 to edit cell & remove " ' " sign than it shows in date format. So I want to know how to remove " ' " sign from each cell in column that has date but not shown as Date format.
Please help me...
Dhanil Shah |
After some thrashing around .... You can't do this in tgh column you want. However, if you create a ne column next to it, you can do this:
Suppose you have '12/12/12 in A1. In B1 put =VALUE(A1)
This puts the proper date format into B1. Copy down the column. HIDE column A. Format B for whatever date format you need.
David. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Thu Apr 08, 2004 7:17 am Post subject: |
|
|
See this article
http://www.oooforum.org/forum/viewtopic.php?p=28389#28389
for an example Visual FoxPro program that.....
1. Creates an OOo Calc spreadsheet
2. Puts some strings into it.
3. Puts some numbers into it.
4. Puts some dates into it (as formulas)
5. Saves it in Calc format (as C:\Example.sxw)
6. Saves it in Excel format (as C:\Example.xls)
7. Closes the document -- but this line is commented to leave the spreadsheet open in OOo
I changed the subject of this thread to be a bit more descriptive. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
David Super User


Joined: 24 Oct 2003 Posts: 5668 Location: Canada
|
Posted: Thu Apr 08, 2004 3:45 pm Post subject: Re: How to remove" ' " sign from a cell |
|
|
| Dhanil Shah wrote: | Hello,
We have one application in Foxpro that generates .xls file. This file gets open perfectly in Openoffice.org file. But in this file one of the column is date. In date, it prefix " ' " sign sothat it is not able to show date as Date Formate i.e. it accepts it as a Text.
If I press F2 to edit cell & remove " ' " sign than it shows in date format. So I want to know how to remove " ' " sign from each cell in column that has date but not shown as Date format.
Please help me...
Dhanil Shah |
I posted anonymously, but it didn't go through. Try this:
In A1 put '12/12/12
In B1 put =value(A1)
Format B1 for date, and hide A1
David. |
|
| Back to top |
|
 |
David Super User


Joined: 24 Oct 2003 Posts: 5668 Location: Canada
|
Posted: Thu Apr 08, 2004 3:47 pm Post subject: Posting messages |
|
|
Wierd. Messages appear in the listing when in the Reply editor, but don't show when the thread header is clicked. Only the original is showing.
Sorry for the double posting.
David. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Apr 09, 2004 1:42 pm Post subject: |
|
|
I have improved the Visual FoxPro Calc example.
http://www.oooforum.org/forum/viewtopic.php?p=28389#28389
If you want to see how to format cells to have a Date format, see this new section....
| Code: | * Format the date cells as dates.
oFormats = oDoc.getNumberFormats()
oLocale = OOoCreateStruct( "com.sun.star.lang.Locale" )
* com.sun.star.util.NumberFormat.DATE = 2
nDateKey = oFormats.getStandardFormat( 2, oLocale )
oCell = oSheet.getCellRangeByName( "C2:C13" )
oCell.NumberFormat = nDateKey
|
Also notice how it now....
* Assigns some dates as DATE() formulas, and some as string values.
* Uses getCellRangeByName() to assign the Dec 31 date. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
|