Playing with XBROWSE

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Playing with XBROWSE

Post by Jimmy »

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: Select all | Expand

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: Select all | Expand

   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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Playing with XBROWSE

Post by Jimmy »

forgot to say dbf2html() is CODE from c:\fwh\samples\dbf2html.prg
greeting,
Jimmy
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Playing with XBROWSE

Post by nageswaragunupudi »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Playing with XBROWSE

Post by nageswaragunupudi »

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: Select all | Expand

oBrw:bEdit := { |oRec| MyDialog( oRec ) }
 
When programmers uses his own dialog, he can use his own colors.

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Playing with XBROWSE

Post by Jimmy »

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: Select all | Expand

     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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Playing with XBROWSE

Post by nageswaragunupudi »

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: Select all | Expand

  XBROWSER "CUSTOMER.DBF" FASTEDIT SETUP ( oBrw:bRClicked := ;
      { || MEMOWRIT( "x.html", FW_DBFTOHTML() ), ;
           HTMLVIEW( TrueName( "x.html" ) ) } )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Playing with XBROWSE

Post by Jimmy »

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: Select all | Expand

  XBROWSER "CUSTOMER.DBF" FASTEDIT SETUP ( oBrw:bRClicked := ;
      { || MEMOWRIT( "x.html", FW_DBFTOHTML() ), ;
           HTMLVIEW( TrueName( "x.html" ) ) } )
 

thx, i will try that Syntax
greeting,
Jimmy
Post Reply