Page 2 of 2

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 5:06 pm
by serge_girard
two I put on comment

Code: Select all

	BEGIN DETAIL

		BANDHEIGHT	6

		BEGIN TEXT
			EXPRESSION	aRows [i] [n]
			ROW		2	
			COL		20	
			WIDTH		80	
			HEIGHT		10	
			FONTNAME	'Helvetica'
			FONTSIZE	9	
			FONTBOLD	.F.
			FONTITALIC	.F.
			FONTUNDERLINE	.F.
			FONTSTRIKEOUT	.F.
			FONTCOLOR	{ 0 , 0 , 0 }
			ALIGNMENT	Left 
		END TEXT
/*
		BEGIN TEXT
			EXPRESSION	aRows [i] [2]
			ROW		2	
			COL		90	
			WIDTH		80
			HEIGHT		10	
			FONTNAME	'Helvetica'
			FONTSIZE	9	
			FONTBOLD	.F.
			FONTITALIC	.F.
			FONTUNDERLINE	.F.
			FONTSTRIKEOUT	.F.
			FONTCOLOR	{ 0 , 0 , 0 }
			ALIGNMENT	Left 
		END TEXT

		BEGIN TEXT
			EXPRESSION	aRows [i] [3]
			ROW		2	
			COL		160	
			WIDTH		80	
			HEIGHT		10	
			FONTNAME	'Helvetica'
			FONTSIZE	9	
			FONTBOLD	.F.
			FONTITALIC	.F.
			FONTUNDERLINE	.F.
			FONTSTRIKEOUT	.F.
			FONTCOLOR	{ 0 , 0 , 0 }
			ALIGNMENT	Left 
		END TEXT */

	END DETAIL

Code: Select all

	BEGIN DETAIL

		BANDHEIGHT	6

		BEGIN TEXT
			EXPRESSION	aRows [i] [n]
			ROW		2	
			COL		20	
			WIDTH		80	
			HEIGHT		10	
			FONTNAME	'Helvetica'
			FONTSIZE	9	
			FONTBOLD	.F.
			FONTITALIC	.F.
			FONTUNDERLINE	.F.
			FONTSTRIKEOUT	.F.
			FONTCOLOR	{ 0 , 0 , 0 }
			ALIGNMENT	Left 
		END TEXT
 

	END DETAIL

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 9:01 pm
by AUGE_OHR
hi,

based on Serge Work i got it "in a loop" to work without *.RMG :!:

Code: Select all

PUBLIC nnn        := 1
PUBLIC iii        := 1
PUBLIC cCodeblock
PUBLIC aRows[ 20 ] [ 3 ]

FUNCTION DoMakeReport( aStructur )
   ...
   FOR nnn := 1 TO nnnMax
      cCodeblock := "{|| aRows[iii] [" + STR( nnn ) + "] }"
      BEGIN TEXT
         EXPRESSION EVAL( &cCodeblock )
i want to use it for SQL-Result where i have Structure ( like DbStruct() )

Code: Select all

   aRows := ::NextCursor( cTable, cField, cWhere, cOrder, cLimit, cOffset, lempty )
as aRows must be PUBLIC i only have to pass Array of Structure

Code: Select all

   DoMakeReport( aStructur )
and than start

Code: Select all

   ExecuteReport( 'Demo', .t., .t. )
attach Source Sample
Array2Report.ZIP
(1.79 KiB) Downloaded 94 times
have fun

Re: REPORT "on-fly" ?

Posted: Fri Feb 11, 2022 2:46 pm
by AUGE_OHR
hi,

still working on REPORT Modul and have a Question : can i use REPORT DEFINITION with "multi-line" :?:

is it when Line is to long so i like to have "multi-line" in DETAIL of REPORT ... but how :idea:

Re: REPORT "on-fly" ?

Posted: Fri Feb 11, 2022 3:15 pm
by serge_girard
did you try with CRLF to split a long line?

Re: REPORT "on-fly" ?

Posted: Fri Feb 11, 2022 6:10 pm
by AUGE_OHR
hi Serge,
serge_girard wrote: Fri Feb 11, 2022 3:15 pm did you try with CRLF to split a long line?
i don´t have a Idee how to use ";" to "Split" Line when work in Loop to "add" FIELD Value to String
i know, when "Add", where i have to "split", but how to put a "second" line with BEGIN TEXT / END TEXT in REPORT :?:

Code: Select all

LOCAL nnnMax := LEN( ::aBroFields )
   ...
   FOR ID_nnn := 1 TO nnnMax
      ...
      if nSumLenField > nMaxPageWide
         // might be recursive when very long line
         New_cCodeblock := SUBSTR(ID_cCodeblock,nLastStart,nMaxPageWide)
         // how to put this to NEXT line ?
         BEGIN TEXT
            EXPRESSION EVAL( &New_cCodeblock )
            ...
         ENDBLOCK 
      ELSE
         BEGIN TEXT
            EXPRESSION EVAL( &ID_cCodeblock )
            ...
         ENDBLOCK 
      ENDIF
i don´t know if it is possible to use a Way like this

Re: REPORT "on-fly" ?

Posted: Sat Feb 12, 2022 1:50 pm
by serge_girard
Jimmy,

just found a minor error in ARR2REPO.PRG:

Output says: 20 records but last record is missing!

Code: Select all

STOPPER iii > LEN( aRows )      
Splitting lines will result in adding a new aRows and changing the original.... this a bit more compex but do-able!

Serge

Re: REPORT "on-fly" ?

Posted: Sat Feb 12, 2022 3:57 pm
by AUGE_OHR
hi Serge,
serge_girard wrote: Sat Feb 12, 2022 1:50 pm just found a minor error in ARR2REPO.PRG:

Output says: 20 records but last record is missing!

Code: Select all

STOPPER iii > LEN( aRows )      
OK, Thx
serge_girard wrote: Sat Feb 12, 2022 1:50 pm Splitting lines will result in adding a new aRows and changing the original.... this a bit more compex but do-able!
AHA ... :idea:
so i need "split" Data when "fill" Array before call Report

Re: REPORT "on-fly" ?

Posted: Sat Feb 12, 2022 4:57 pm
by serge_girard
exact !