Browse/report with accordeon

This forum is for eXpress++ general support.
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Browse/report with accordeon

#11 Post by skiman »

Hi,

I'm aware that the report control isn't the fastest object of the codejock suite. In this case I don't have large datasets. I tested with 1000 lines, and came to the conclusion that it is acceptable. I has quite some power in it. With drag and drop you can get totals and subtotals as you want.

Doing the same in a dcbrowse will certainly be possible. However this would take me maybe two weeks of work or even more. Now I had spend only 3 hours.

Tom, are you a speaker at the Devcon in the Netherlands in November?
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Browse/report with accordeon

#12 Post by Auge_Ohr »

unixkd wrote:Try to populate 5000 items on the codejock report control, you will come back home quickly.
this is when using "single additem" with Listview ...

when using LVS_OWNERDATA and LVN_GETDISPINFO you can show Array with 100000 in < 1 Sec.
(to build Array take more time ... )
unixkd wrote:In terms of performance on large datasets nothing close to Xbase++ in the market today except you are coding in C/C++.
hm ... when talk about "SKIP" i agree ... but this is also the "Problem" with XbpBrowse() using a "DbSkipper".

when "browse" a big SQL-Result Set with a "Skipper" does not make Sence ... better to divide Query with LIMIT and OFFSET into Parts.
Listview does have LVN_ODCACHEHINT Notify Event and NMLVCACHEHINT Structure does give you

Code: Select all

   //
   // cache the data pCacheHint->iFrom to pCacheHint->iTo ...
   //
   nFrom   := st:iFrom
   nTo     := st:iTo

   cText := "Cache from "+LTRIM(STR(nFrom))+" to "+LTRIM(STR(nTo))
which can be used to build a Databinding.
look for new Demo Source at http://bb.donnay-software.com/donnay/vi ... f=7&t=1583
greetings by OHR
Jimmy

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: Browse/report with accordeon

#13 Post by unixkd »

Hi Jimmy

What do you mean by:

this is when using "single additem" with Listview ...

when using LVS_OWNERDATA and LVN_GETDISPINFO you can show Array with 100000 in < 1 Sec.
(to build Array take more time ... )

I noticed that all codejock controls in my application takes time for the dialog to show up.

Thanks.

Joe

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Browse/report with accordeon

#14 Post by Auge_Ohr »

hi,

back to a old Thread ... where i just working on ;-)

i found out that XbpTreeviewItem() have no Handle ( o:GetHwnd() ) so it seem me not possible to "replace" it.

i also had to change some Design in my native DXE_Treeview() to use it together with DXE_Listview()

Code: Select all

CLASS DXE_Report ftom DXE_Treeview, DXE_Listview
unixkd wrote:What do you mean by:
each o:AddItem need some Windows Call e.g. reserve Memory. using ActiveX will increase time.

but Windows Controls can more than Xbase++ let us do

Code: Select all

INLINE METHOD LB_InitStorage(nNum,nBytes)
/****************************************************************
*  Allocates memory for the specified number of items and their associated strings.
*
*  wParam
*     The number of items to add.
*
*  lParam
*     The amount of memory, in bytes, to allocate for item strings.
*
*  Return Value
*     If an error occurs, the return value is LB_ERR.
*
*****************************************************************/
RETURN @User32:SendMessageA(::hLbox,LB_INITSTORAGE,nNum,nBytes )
so i can use it this Way

Code: Select all

INLINE METHOD _AddBigArray(aArray)
LOCAL iMax   := LEN(aArray)
LOCAL nLen   := 0
LOCAL nBytes

   // find max Item Lenght
   //
   AEval( aArray, {|x,i| IF(LEN(x)>nLen,nLen:=LEN(x),NIL) } )

   // reserve Memory
   //
   nBytes := iMax * nLen
   ::LB_InitStorage(iMax,nBytes)

   // store hole Array for (my) internal use
   //
   ::aItems := ACLONE( aArray )

   // AddString to Listbox
   //
   // Note : when Ownerdraw DATA, Window might limited
   //        so you need you ::NumItems() of LB_ADDSTRING
   //
   //        ::LB_SetItemData(nIndex,cString) will just
   //        "replace" DATA when need to display
   //
   AEval( ::aItems, {|x,i| @User32:SendMessageA( ::hLBox,LB_ADDSTRING,0, x) } )

RETURN
something like this can be used for every 2D*** Windows Control

*** Parent which use o:AddiTem to get Child

---

using LVS_OWNERDATA as Style let you use your own Data e.g. Array ... but Data must be display somehow.

have you see Demo Source ? http://bb.donnay-software.com/donnay/vi ... f=7&t=1583

think about Ownerdraw ...

Code: Select all

Xbase++ Syntax :
   {| oPS, aInfo, self | ... }
aInfo[1][1] does contain a "Index" ...

older Windows Controls, like XbParts, do not have "data binding" ... but you can simulate it with a "Index".

but how to display data now ... i have to check a Event (like o:subscribeEvent() )

Code: Select all

// add for LVS_OWNERDATA
//
   ::SetLvNotifyCB( LVN_GETDISPINFO  , {|o,notify_code,lp| ::OnDISPINFO(o,lp) } )
this is when LVN_GETDISPINFO Event is fired to display data where i need to react on

Code: Select all

METHOD DXE_ArrayView:OnDISPINFO(o,lp)
   ...
   IF LEN(::aSource) > 0		// My Array

      st := NMLVDISPINFO():New()	// Windows Structure
      st:_link_(lp,.F.)

// need for 64bit OS()
//
      st:item:pszText     := REPLICATE(CHR(0),255)
      st:item:cchTextMax  := 255

// ZERO-based :iItem and :iSubItem
//
      nRec        := st:item:iItem+1            // Array ZERO-based+1
      nSub        := st:item:iSubItem+1         // always 0 when Ownerdraw ?

// use My Array
//
      ctext := ::aSource[nRec][nSub]	// here i use "Index" on My Array to get Data
like Ownerdraw i have Control "what" to Display ... just need "Index" to locate my Data to display
greetings by OHR
Jimmy

Post Reply