FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Single char " from a DBF breaks a Excel-Sheet ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Single char " from a DBF breaks a Excel-Sheet ?
Posted: Tue Jul 09, 2013 01: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.



adding Char " breaks the Exel-sheet



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.
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Tue Jul 09, 2013 01:49 PM

Did you try ""?

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Tue Jul 09, 2013 04: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)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Tue Jul 09, 2013 04:37 PM
I tested with the 2. VKey-table.
It seems only " " as a pair is possible in Excel and are not visible.







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.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Wed Jul 10, 2013 08: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 '



The DATA-part of the Excel-sheet
Code (fw): Select all Collapse
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 :-)
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Wed Jul 10, 2013 02: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Single char " from a DBF breaks a Excel-Sheet ?
Posted: Wed Jul 10, 2013 03:52 PM
Mr. Rao,
thank You very much.
Adding this line, has done the job :

oBrw:lExcelCellWise := .t.



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.

Continue the discussion