now i want to "FASTEDIT" Sheet but how to configure XBROWSE and/or "ADODB.Recordset"
function EditExcelRange()
local oRange := GetExcelRange( TrueName( "test3.xlsx" ) )
BrowseIt( oRange )
return nil
static function BrowseIt( u )
local oWnd, oBrw
DEFINE WINDOW oWnd TITLE "Edit ExcelRange " + FWVERSION
@ 0,0 XBROWSE oBrw SIZE 0,0 PIXEL DATASOURCE u ;
AUTOCOLS FASTEDIT CELL LINES NOBORDER
WITH OBJECT oBrw
:nEditTypes := { 1,1,1 }
:CreateFromCode()
END
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd CENTERED
return nil
:nEditTypes := { 1,1,1 }
:nEditTypes := EDIT_GET
what is
Code:
:nEditTypes := { 1,1,1 }
i "normal" knew
Code:
:nEditTypes := EDIT_GET
so what is Array mean
AEval( oBrw:aCols, { |o| o:anydata := uVal } )
for n := 1 to Len( aValues )
oBrw:oCol( n ):anydata := aValues[ n ]
next
oBrw:oCol( c ) // --> oCol whose header is "c"
oBrw:oCol( "anydata", uVal ) --> oCol where oCol:anydata is uVal
oBrw:oCol( {|o|cond} ) --> oCol which satisfies the condition in the codeblock
aSortOrders := oBrw:cSortOrders
? aSortOrders
but it does not work for me with "big" *.XLSx ... (work only with small Sample)
i wonder "how" GetExcelRange() will work as it "only" Return oRange, not Recorsd-Set
what i´m doing now
1.) Connection -> FW_OpenADOExcelBook() -> return oCn
2.) Record-Set -> FW_OpenADOExcelSheet() -> return oRs
FUNCTION ADOsheet( cFile )
LOCAL cTitle := cFile
LOCAL objRS, oBrw, jj, aEdit := {}
LOCAL cSheet, cRange, lHeaders := .T.
LOCAL oFont, oDlg
objRS := FW_OpenADOExcelSheet( cFile, cSheet, cRange, lHeaders )
FOR jj := 0 TO objRS:Fields:Count - 1 // FIELDs are zero-based
AADD(aEdit, EDIT_GET)
NEXT
SET CENTURY ON
SET DATE GERMAN
DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 18
ACTIVATE FONT oFont
END FONT
DEFINE DIALOG oDlg SIZE 1280, 1024 PIXEL FONT oFont TITLE cTitle COLOR BFcolor, BGcolor ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )
@ 1, 1 XBROWSE oBrw SIZE - 1, - 1 PIXEL OF oDlg ;
RECORDSET objRS ;
AUTOCOLS ;
CELL LINES NOBORDER FASTEDIT UPDATE ;
FONT oFont COLOR BFcolor, BGcolor
oBrw:nEditTypes := aEdit
oBrw:CreateFromCode()
END DIALOG
ACTIVATE DIALOG oDlg CENTERED
objRS:Close()
RELEASE FONT oFont
RETURN nil
FOR jj := 0 TO objRS:Fields:Count - 1 // FIELDs are zero-based
AADD(aEdit, EDIT_GET)
NEXT
//
//
oBrw:nEditTypes := aEdit
oBrw:nEditTypes := EDIT_GET
want to build a Tool which can "read/write" *.XLSx without EXCEL
but i must install ADO "Pack" ( Microsoft.ACE.OLEDB.12.0 ) else FW_OpenADOExcelSheet() will fail
CODE run fine using BCC7 32 Bit but with MSVC 64 Bit XBROWSE is not "refresh" after "edit"
how to get "Inline Edit?
can i use oBrowse:EditSource() with Record-Set ? ( Header as "Structure" ? )
can i "seek" in XBROWSE when use a Record-Set ?
how do i get active ROW / COL where Cursor are ?
nageswaragunupudi wrote:This is not necessary:
This single line is enough:
- Code: Select all Expand view
oBrw:nEditTypes := EDIT_GET
nageswaragunupudi wrote:ACE OLEDB installed on the target computer can be 32-bits version or 64-bits version.
If our application is 32bits, it can use only ACE 32-bit provider only.
To use 64-bit ACE provider, we need to build our application in 64-bits.
So which application we distribute? Our 32/64 bit application?
nageswaragunupudi wrote:if
oCol:nEditType is > 0 and
oCol:lReadOnly is .F. ( default ) and
oCol:bEditWhen is NIL (default ) or Evaluates to .T.
Inline Edit of the cell is automatically available (whether oBrw:lFastEdit is .T. or .F. )
oBrw:nEditTypes := EDIT_GET // work
oBrw:lReadOnly := .F. // no Effect ?
oBrw:bEditWhen := {|| .T. } // no Effect ?
oBrw:CreateFromCode()
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 51 guests