FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Playing with XBROWSE
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Playing with XBROWSE
Posted: Thu Apr 06, 2023 04:57 PM
hi,

i´m playing with XBROWSE and got a Error when did this from XBROWSE

a.) Dbf2HTML( cPath + cFile, cAlias )
b-) oBrwDBF:ToExcel()
Error description: (DOS Error -2147352567) WINOLE/1007 Die Paste-Eigenschaft des Worksheet-Objektes kann nicht zugeordnet werden. (0x800A03EC): Microsoft Office Excel

Stack Calls
===========
Called from: => TOLEAUTO:PASTE( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL( 10792 )
Called from: .\DUALGRID.PRG => (b)DOSHOWDBF( 2572 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 792 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 1083 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1847 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2135 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3681 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1114 )
Called from: .\DUALGRID.PRG => MAIN( 920 )
it does work when call oBrwDBF:ToExcel() "direct"

---

i have look for METHOD ToExcel but not found in Help File
Code (fw): Select all Collapse
METHOD ToExcel( bProgress, nGroupBy, aCols, lShow, cPDF, bPrePDF ) CLASS TXBrowse
i do understand cPDF but how Codeblock bPrePDF look like ... can´t find a Sample :?:

---

when add a new Record
Code (fw): Select all Collapse
   oBrwDBF:EditSource( .t. )
i got a Windows ... but i can´t find "the" Window ... "where" is it :?:

Question : can i set "color" to Window / Dialog like EditSource() :?:
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Playing with XBROWSE
Posted: Thu Apr 06, 2023 05:50 PM

forgot to say dbf2html() is CODE from c:\fwh\samples\dbf2html.prg

greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Playing with XBROWSE
Posted: Fri Apr 07, 2023 02:22 AM

Dbf2Html() uses the function FW_DBFTOHTML()

Did you get any error using this function?

This function has nothing to do with XBrowse and its method ToExcel(). May we know why are you combining Dbf2HTML() and XBrowse?

bPrePDF:

In case the programmer wants to make some additions to the excel sheeet before saving as PDF, he can do so by using bPrePdf codeblock, which is evaluated with oSheet as parameter.

We can not comment on the runtime error without knowing anything about the DBF or the program code of DoShowDBF()

Altenatively, can you suggest name of any dbf file in fwh\samples to test at our end?

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Playing with XBROWSE
Posted: Fri Apr 07, 2023 02:59 AM
when add a new Record
Code:
oBrwDBF:EditSource( .t. )

i got a Windows ... but i can´t find "the" Window ... "where" is it :?:

Question : can i set "color" to Window / Dialog like EditSource() :?:
We see Dialog (not Window).
When we use oBrw:EditSource( [lAppend] ) , XBrowse + DataRow display a default dialog that works with all kinds of datasources.
Programmer can use his own dialog by assigning
Code (fw): Select all Collapse
oBrw:bEdit := { |oRec| MyDialog( oRec ) }
When programmers uses his own dialog, he can use his own colors.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Playing with XBROWSE
Posted: Sun Apr 09, 2023 04:49 AM
hi,

thx for Answer.

as you say i have "mix" Dbf2Htm() and ToExcel(), sorry for confuse
We can not comment on the runtime error without knowing anything about the DBF or the program code of DoShowDBF()

i do start both from BUTTONBAR of XBROWSE
Code (fw): Select all Collapse
      DEFINE WINDOW oWnd FROM 0, 0 TO 1024, 1280 PIXEL TITLE "DBF " + cFile ICON "A1MAIN" COLOR BFcolor, BGcolor

         DEFINE BUTTONBAR oBar SIZE 96, 48 OF oWnd BRUSH oBrush

               DEFINE BUTTON OF oBar PROMPT "to &HTML" ;
                            NOBORDER RESOURCE "MYHTML" ;
                            ACTION Dbf2HTML( cPath + cFile, cAlias )

               DEFINE BUTTON OF oBar PROMPT "to &Excel" ;
                            NOBORDER RESOURCE "MYEXCEL" ;
                            ACTION oBrwDBF:ToExcel()

            @ 24,  0 XBROWSE oBrwDBF PIXEL OF oWnd ;
                                 FONT oFontDefault ;
                            COLOR BFcolor, BGcolor ;
                            ALIAS cAlias AUTOCOLS CELL LINES NOBORDER FASTEDIT

i do press Button for Dbf2HTML() and it work as expect
after close Dialog i press Button for oBrwDBF:ToExcel(). now it crash

it does not crask when ress Button for oBrwDBF:ToExcel() "direct", only in this "Combination"

When we use oBrw:EditSource( [lAppend] ) , XBrowse + DataRow display a default dialog that works with all kinds of datasources.

but "where" is the Dialog as i can´t find DEFINE DIALOG in Xbrowse.prg which point to it :-)
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Playing with XBROWSE
Posted: Sun Apr 09, 2023 06:16 AM
i do press Button for Dbf2HTML() and it work as expect
after close Dialog i press Button for oBrwDBF:ToExcel(). now it crash

The problem must be with the function Dbf2Html() as adapted by you.
Most likely you are closing DBFs before exiting the function.

I tested with this single line code and everything is working perfectly
Code (fw): Select all Collapse
   XBROWSER "CUSTOMER.DBF" FASTEDIT SETUP ( oBrw:bRClicked := ;
      { || MEMOWRIT( "x.html", FW_DBFTOHTML() ), ;
           HTMLVIEW( TrueName( "x.html" ) ) } )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Playing with XBROWSE
Posted: Sun Apr 09, 2023 06:58 AM
hi,
nageswaragunupudi wrote:The problem must be with the function Dbf2Html() as adapted by you.
Most likely you are closing DBFs before exiting the function.

ok, understood

nageswaragunupudi wrote:I tested with this single line code and everything is working perfectly
Code (fw): Select all Collapse
   XBROWSER "CUSTOMER.DBF" FASTEDIT SETUP ( oBrw:bRClicked := ;
      { || MEMOWRIT( "x.html", FW_DBFTOHTML() ), ;
           HTMLVIEW( TrueName( "x.html" ) ) } )

thx, i will try that Syntax
greeting,

Jimmy

Continue the discussion