Parsing data into function from folderex and Xbrowse

Parsing data into function from folderex and Xbrowse

Postby Marc Venken » Fri Jul 27, 2018 3:49 pm

Hello,

I have a folderex with several folders. Each folder has 1 xbrowse into it.
On top I also have a btnbar with a exel btn.

It is at this moment 39 degrees in Belgium (Not a normal temp) and I'm missing the clue ))))

What I try to do.

From every tab, when I click on the exel btn, the exel file should show the data from that tab. (now It always show tab1 data)

Here is some code

Code: Select all  Expand view  RUN

   DEFINE FONT oBold NAME 'CALIBRI' SIZE 0,-12 BOLD
   DEFINE FONT oFont NAME "CALIBRI" SIZE 0,-14
   DEFINE FONT oFontBig NAME "CALIBRI" SIZE 0,-24

   DEFINE DIALOG oDlg SIZE 1280,720 PIXEL TRUEPIXEL ;
   STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME );
   TITLE "Ledenlijst : ";
   GRADIENT { { 1, nRGB( 125, 155, 175 ), nRGB( 125, 155, 175 ) } }

   DEFINE BUTTONBAR oBar OF oDlg SIZE 56,56 2007

   //@ 95,05 FOLDER oFld SIZE 1100,610 PIXEL OF oDlg ITEMS aTabs
   @ 95,05 FOLDEREX SIZE 1100,610 oFld PIXEL ROUND 5 UPDATE ;
    PROMPT  "Basis", "Email/Gsm", "Administratie", "Ploegen", "Beschikbaarheid", "Trainingen/Wedstrijden","Inventaris"

 


several xbrowse (all alike with different fields)

Code: Select all  Expand view  RUN


   @ 0,0 XBROWSE oBrw[2] size -1,-1 PIXEL OF  oFld:aDialogs[ 2 ] font oFont ;
      DATASOURCE oRs ;
      COLUMNS aVelden2;
      AUTOSORT CELL LINES NOBORDER FOOTERS
      //FASTEDIT

// rest of xbrowse setup ......
   oBrw[2]:CreateFromCode()

   BrwBarBtns( oBar, oBrw[2], oFld:nOption  )

// other Xbrowse


   @ 0,0 XBROWSE oBrw[3] size -1,-1 PIXEL OF  oFld:aDialogs[ 3 ] font oFont ;
      DATASOURCE oRs ;
      COLUMNS aVelden3;
      AUTOSORT CELL LINES NOBORDER FOOTERS
      //FASTEDIT

     oBrw[3]:nEditTypes = EDIT_GET


   oBrw[3]:CreateFromCode()

   BrwBarBtns( oBar, oBrw[3], oFld:nOption  )

 


and the function for the btnbar

Code: Select all  Expand view  RUN

function BrwBarBtns( oBar, oBrw, nFolder )
   local n := 1
 
     DEFINE BUTTON OF oBar FILE "img\new2.bmp" PROMPT "Add"  GROUP TOOLTIP "Add New Record" ;
        ACTION oBrw:EditSource( .t. )
     DEFINE BUTTON OF oBar FILE "img\edit.bmp" PROMPT "Edit" TOOLTIP "Edit Record" ;
        ACTION oBrw:EditSource()
     DEFINE BUTTON OF oBar FILE "img\excel.bmp" PROMPT "Excel"  GROUP TOOLTIP "Export to Excel" ;
        ACTION oBrw:ToExcel()
     DEFINE BUTTON OF oBar FILE "img\printquick16.bmp" PROMPT "Print" TOOLTIP "Print Report" ;
        ACTION oBrw:Report()
 

return nil

 


What is wrong ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1447
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Parsing data into function from folderex and Xbrowse

Postby FranciscoA » Fri Jul 27, 2018 4:44 pm

Have you tried with oBrw:SetFocus() ?

Code: Select all  Expand view  RUN
function BrwBarBtns( oBar, oBrw, nFolder )
   local n := 1
 
         DEFINE BUTTON OF oBar FILE "img\new2.bmp" PROMPT "Add"  GROUP TOOLTIP "Add New Record" ;
        ACTION oBrw:EditSource( .t. )
     DEFINE BUTTON OF oBar FILE "img\edit.bmp" PROMPT "Edit" TOOLTIP "Edit Record" ;
        ACTION oBrw:EditSource()
     DEFINE BUTTON OF oBar FILE "img\excel.bmp" PROMPT "Excel"  GROUP TOOLTIP "Export to Excel" ;
        ACTION ( oBrw:SetFocus(), oBrw:ToExcel() )
     DEFINE BUTTON OF oBar FILE "img\printquick16.bmp" PROMPT "Print" TOOLTIP "Print Report" ;
        ACTION oBrw:Report()
 
return ni
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Parsing data into function from folderex and Xbrowse

Postby nageswaragunupudi » Sat Jul 28, 2018 6:19 am

ACTION TXBrowse():oActive:ToExcel()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Parsing data into function from folderex and Xbrowse

Postby Marc Venken » Sun Jul 29, 2018 11:14 am

Thank you. Works !
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1447
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 51 guests