Single char " from a DBF breaks a Excel-Sheet ?

Single char " from a DBF breaks a Excel-Sheet ?

Postby ukoenig » Tue Jul 09, 2013 1:38 pm

Hello,

from a DBF I show different single Chars in a Excel-sheet
A single char " breaks it.
Is it possible to display "
This char seems to be a problem.
I defined it, to be displayed LARGE in this post.
Nothing happens und still shows a normal size.
Also a color-define doesn't work.

Image

adding Char " breaks the Exel-sheet

Image

Best Regards
Uwe :?:
Last edited by ukoenig on Tue Jul 09, 2013 4:34 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby ADutheil » Tue Jul 09, 2013 1:49 pm

Did you try ""?
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby Jeff Barnes » Tue Jul 09, 2013 4:13 pm

You might need to put a single quote in front of it. ( ' )
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby ukoenig » Tue Jul 09, 2013 4:37 pm

I tested with the 2. VKey-table.
It seems only " " as a pair is possible in Excel and are not visible.

Image

Image

Image

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby ukoenig » Wed Jul 10, 2013 8:03 am

I found a solution to display a single "

1. I created a extra Excel-function
2. I converted the field " to a extra string using two '

Image

The DATA-part of the Excel-sheet
Code: Select all  Expand view

DBSELECTAREA(1)
DBGOTOP()
DO WHILE ! eof()
    xRange := ltrim(str(nRow))     // Cell
    nRow++
    cChar1 := (1)->CHAR1
    IF cChar1 = '"'
        cChar1 := "''"
    ENDIF   
    cChar2 := (1)->CHAR2
    IF cChar2 = '"'
        cChar2 := "''"
    ENDIF   
    cChar3 := (1)->CHAR3
    IF cChar3 = '"'
        cChar3 := "''"
    ENDIF   
    cChar4 := (1)->CHAR4
    IF cChar4 = '"'
        cChar4 := "''"
    ENDIF   

    oClp:SetText( cChar1 + chr( 9 ) + ;
                (1)->VALUE1 + chr( 9 ) + ;
                cChar2 + chr( 9 ) + ;
                (1)->VALUE2 + chr( 9 ) + ;
                cChar3 + chr( 9 ) + ;
                (1)->VALUE3 + chr( 9 ) + ;
                cChar4 + chr( 9 ) + ;
                (1)->VALUE4 + chr( 9 ) )

    oSheet:Cells( nRow, 1 ):Select()
    oSheet:Paste()
    oClp:Clear()

    DBSELECTAREA(1)
    (1)->( DbSkip() )

    SysRefresh()
 


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby nageswaragunupudi » Wed Jul 10, 2013 2:25 pm

If you are developing your own logic to export to excel, I have no comments.

But if you are using XBrowse to export to Excel:

1. If the browse is an array browse, there is no problem. Single " is exported correctly.

2. If you want to export from a browse of DBF, please set
oBrw:lExcelCellWise := .t.
and the export of single " will be correct.

3. From next version of FWH the export will be fine in all cases.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Single char " from a DBF breaks a Excel-Sheet ?

Postby ukoenig » Wed Jul 10, 2013 3:52 pm

Mr. Rao,
thank You very much.
Adding this line, has done the job :

oBrw:lExcelCellWise := .t.

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 109 guests