Strange result with Xbrowse and oBrw:toexcel

Strange result with Xbrowse and oBrw:toexcel

Postby Marc Venken » Tue Jul 06, 2021 9:39 pm

Using this code :

@ 880,400 BTNBMP oBtn1 OF oDlg SIZE 200, 30 NOBORDER PROMPT "Prijswijzigingen naar Exel" 2007 TOOLTIP "Tool1" ACTION exportdata(obrw4)

Code: Select all  Expand view
function exportdata(oBrw)
  select nofoto
  set filter to nofoto->selected
  oBrw:refresh()
  oBrw:ToExcel( NIL,NIL, { oBrw:oCol( "Id" ), oBrw:oCol( "Brandid" ), oBrw:oCol( "Benaming" ) } )
  //METHOD ToExcel( bProgress, nGroupBy, aCols, lShow, cPDF, bPrePDF ) CLASS TXBrowse
  set filter to
  oBrw:refresh()
return
 


I get a excel with the 3 columns = OK, but i also get 3 group headers (Webshop, Maveco, Brand)
These groupheaders are coded in xbrowse setup :

:SetGroupHeader( "Webshop", oBrw4:oCol("Shopprijs"):nCreationOrder, oBrw4:oCol("Shopmarge"):nCreationOrder )
:SetGroupHeader( "Brand", oBrw4:oCol("Bruto"):nCreationOrder, oBrw4:oCol("OudBruto"):nCreationOrder )
:SetGroupHeader( "Maveco", oBrw4:oCol("Prijs_1"):nCreationOrder, oBrw4:oCol("Marge"):nCreationOrder )

Is there a setting that ToExcel is not showing them ? I'm not sure of the options for nGroupBy values...

result of excel...

Id BrandId Benaming Webshop Maveco Brand (

1042PB LB_1042PB TROUSER 1042PB GREY 44
1043PB LB_1043PB TROUSER 1043PB WHITE 44
1052PB LB_1052PB TROUSER 1052PB GREY 44
1053PB LB_1053PB SHORTS 1053PB KHAKI 44
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Strange result with Xbrowse and oBrw:toexcel

Postby ukoenig » Fri Jul 09, 2021 11:56 am

Marc,

groupheaders
Is there a setting that ToExcel is not showing them ?


there is a switch

add to the button-action or function

button

ACTION ( oBrw4:lGrpHeader := .F. , ;
exportdata(obrw4), ;
oBrw:lGrpHeader := .T. )

or inside Your function

...
oBrw:lGrpHeader := .F. , ; // oBrw:SetGroupHeader() OFF
oBrw:ToExcel( NIL,NIL, { oBrw:oCol( "Id" ), oBrw:oCol( "Brandid" ), oBrw:oCol( "Benaming" ) } )
oBrw:lGrpHeader := .T. ) // oBrw:SetGroupHeader() ON
...

regards
Uwe :D
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: Strange result with Xbrowse and oBrw:toexcel

Postby Marc Venken » Fri Jul 09, 2021 12:44 pm

Thanks Uwe...
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests