Thanks igorsandler,
I think this logic could be workaround but if Item name doesn't fit it's stretch with overflow is arked so it goes to next row. So if 4 items overflow then from 10 items which I can print , I practically get space of 6 items. So I am trying to instantiate reportlistner object and in the method - adjustobjectsize , I am trying to do something like below . Will come will proper solution if it succeeds
Define Class Invoice_Listener As ReportListener
PROCEDURE INIT
LPARAMETERS r_frxfile
THIS.AddProperty("nPageFooterPos",170) &&& 170 comes from 0.177(height of page footer band) * 960
*-----------------------------
&& ADDING THE COMMENTS OF THE USER TO THE REPORT OBJECT
&& called for the refrence in the
closefiles( 'frxfile0')
LOCAL al
al = ALIAS()
SELECT 0
USE &r_frxfile ALIAS frxfile0 AGAIN
LOCAL cc
cc= "This.Addproperty('USERVALEUS(" + ALLTRIM(STR( RECCOUNT())) +",3)','')"
&cc
*-----------------------------
SELECT frxfile0
SCAN
This.UserValeus( RECNO(),1) = RECNO()
This.UserValeus( RECNO(),2) = UPPER(ALLTRIM(frxfile0.user))
This.UserValeus( RECNO(),3) = ALLTRIM(frxfile0.expr)
&& storing the values of the user field in the property UserValeus of the report object
ENDSCAN
*------------------------------
IF !EMPTY(al)
SELECT &al
ENDIF
ENDPROC
Procedure AdjustObjectSize
Lparameters tnFRXRecno, toObjProperties, toFRX
*-- If it won't fit, increase the height of
*-- the shape to fill up the rest of the page
NOTE In Frx in "User" Comment field - 'ITEM : PRINT_CUR'
If 'ITEM' $ Capt(This.UserValeus( tnFRXRecno,2))
CURNAMEV = Alltrim(GETWORDNUM(This.UserValeus( tnFRXRecno,2),2,':'))
If !Empty(CURNAMEV)
**- Note 1) 210 is calculated as 0.0229 * 960
*- 2) By putting Messageboxes and noting diif. for 2 consecutive lines
*!* messagebox( toObjProperties.Top )
*!* messagebox( toObjProperties.maxheightavailable ) &&-> Max Height Available
*!* messagebox( &CURNAMEV..MX * 220 )
*!* IF BETWEEN(RECNO('&CURNAMEV'),56,59)
*!* messagebox( toObjProperties.Top )
*!* messagebox( &CURNAMEV..MX * 210 )
*!* messagebox( toObjProperties.maxheightavailable )
*!*
*!* ENDIF
NOTE : 210 IS THE HEIGHT OF DETAIIL BAND
If (&CURNAMEV..MX-&CURNAMEV..MARK+1) * 210 > toObjProperties.maxheightavailable
&& Go To The Next page , so increasing height of the object
toObjProperties.Height = toObjProperties.maxheightavailable
* messagebox( toObjProperties.Height )
* REPLACE PRT WITH .T. IN &CURNAMEV
toObjProperties.Reload = .T.
* BROWSE
ENDIF
* BROWSE
Endif
Endif
DoDefault()
Endproc
Enddefine