Hi everyone
This is the sample program
using oBrw:ToExcel() form the menu produce next ERROR
Application
===========
Path and name: E:\FWH\samples\testxbr9.exe (32 bits)
Size: 2,001,920 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 04/17/12, 22:36:19
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HWND
Args:
[ 1] = U
Stack Calls
===========
Called from: => HWND(0)
Called from: .\source\classes\CLIPBRD.PRG => (b)TCLIPBOARD:TCLIPBOARD(26)
Called from: => TCLIPBOARD:OPEN(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL(6737)
Called from: testxbr9.prg => (b)EXCELMENU(66)
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE(474)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:SHOWPOPUP(1484)
Called from: testxbr9.prg => (b)BTNBAR(55)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(466)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(660)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1455)
Called from: .\source\classes\WINDOW.PRG => _FWH(3409)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: testxbr9.prg => MAIN(35)
IF I ADD
oBrw:lExcelCellWise := .t.
to program exporting to Excel working good but
CREATING THE EXCEL FILE IS 20 TIMES SLOWER (may be more)
Any help or some sugestions please ?
Best Regards,
This is the sample program
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oDlg, oBrw, oCol, cAlias := cGetNewAlias( "CUST" )
USE CUSTOMER NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
SET ORDER TO TAG FIRST
GO TOP
DEFINE DIALOG oDlg SIZE 900,500 TITLE "Test"
@ 33, 0 XBROWSE oBrw OF oDlg SIZE 400,200 PIXEL ;
ALIAS cAlias ;
AUTOCOLS AUTOSORT FOOTERS LINES CELL
if !Empty( oCol := oBrw:oCol( "Salary" ) )
oCol:nTotal := 0
oCol:lTotal := .t.
oCol:nEditType := EDIT_GET
endif
oBrw:MakeTotals()
oBrw:CreateFromCode()
// oBrw:lExcelCellWise := .t.
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oBrw:SetFocus(), BtnBar(oDlg,oBrw) )
(cAlias)->( dbCloseArea() )
return nil
//----------------------------------------------------------------------------//
static function BtnBar(oDlg,oBrw)
local oBar, oBtn
DEFINE BUTTONBAR oBar OF oDlg SIZE 56,64 2007
DEFINE BUTTON OF oBar ;
RESOURCE "EXCEL" TOP ;
PROMPT "Excel" ;
ACTION This:ShowPopUp() ;
MENU ExcelMenu(oBrw) ;
MESSAGE "Export browse contents to Excel" ;
TOOLTIP { "Export to Excel", "Excel" }
return oBar
//----------------------------------------------------------------------------//
static function ExcelMenu(oBrw)
local oPop
MENU oPop POPUP 2007
MENUITEM "Export to Excel" ACTION (cursorwait(),oBrw:ToExcel(),cursorarrow())
MENUITEM "Export to Excel with Group Totals" ;
WHEN ! Empty( oBrw:GetVisibleCols()[1]:cOrder ) ;
ACTION oBrw:ToExcel(,1)
ENDMENU
return oPop
using oBrw:ToExcel() form the menu produce next ERROR
Application
===========
Path and name: E:\FWH\samples\testxbr9.exe (32 bits)
Size: 2,001,920 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 04/17/12, 22:36:19
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HWND
Args:
[ 1] = U
Stack Calls
===========
Called from: => HWND(0)
Called from: .\source\classes\CLIPBRD.PRG => (b)TCLIPBOARD:TCLIPBOARD(26)
Called from: => TCLIPBOARD:OPEN(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL(6737)
Called from: testxbr9.prg => (b)EXCELMENU(66)
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE(474)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:SHOWPOPUP(1484)
Called from: testxbr9.prg => (b)BTNBAR(55)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(466)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(660)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1455)
Called from: .\source\classes\WINDOW.PRG => _FWH(3409)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: testxbr9.prg => MAIN(35)
IF I ADD
oBrw:lExcelCellWise := .t.
to program exporting to Excel working good but
CREATING THE EXCEL FILE IS 20 TIMES SLOWER (may be more)
Any help or some sugestions please ?
Best Regards,