Page 1 of 2

REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 9:14 am
by AUGE_OHR
hi,

i do use

Code: Select all

   DEFINE REPORT Demo
with Array

Code: Select all

   Public iii := 1
   Public aRows [ 20 ] [ 3 ]
   aRows [1]   := {'Simpson','Homer','555-5555'}
   ...
   aRows [20]  := {'Reyes','Monica','432-5836'}
and this in REPORT

Code: Select all

   BEGIN DATA
      ITERATOR iii++
      STOPPER  iii == 20
   END DATA
and have 3 x this

Code: Select all

   BEGIN TEXT
      EXPRESSION  aRows [iii] [1]
      ...
   END TEXT     
   BEGIN TEXT
      EXPRESSION  aRows [iii] [2]
      ...
   END TEXT     
   BEGIN TEXT
      EXPRESSION  aRows [iii] [3]
      ...
   END TEXT


now i try to create it i a loop

Code: Select all

PUBLIC nnn
   ...
   FOR nnn := 1 TO 3 // nnnMax
      BEGIN TEXT
         EXPRESSION  aRows [iii] [nnn]
         ...
      END TEXT     
   NEXT 
and got this Error
Error BASE/1132 Bound error array access Parameter : [ 1] = A { 3 } [ 2] = N 4
Called from _PRINTTEXT(1191)
Called from _PRINTOBJECT(1140)
Called from _PROCESSBAND(1118)
Called from EXECUTEREPORT(879)
Called from FILLPDF(55)
i don´t understand "where" i got 4 while my loop is only 1 TO 3
what i´m doing wrong ... out of Idee :cry:

who have a Idee :idea:

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 10:43 am
by danielmaximiliano
hay veces que la logica se ve bien pero el codigo no, iii tiene un valor porque "Bound error" es que la matriz esta fuera del limite ..

Code: Select all

PUBLIC nnn
   ...
   FOR nnn := 1 TO 3 // nnnMax
      BEGIN TEXT
         EXPRESSION  aRows [iii] [nnn]
         ...
      END TEXT     
   NEXT 
puede usar msgdebug para ver el contenido de su array dentro del bucle

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 11:08 am
by AUGE_OHR
hi,

i got it that it is a "normal" Problem of a loop with Counter ...
but i have not found Solution yet :(

who have the right Way for this Problem :?:

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 12:17 pm
by SALINETAS24
AUGE_OHR wrote: Tue Feb 08, 2022 11:08 am hi,

i got it that it is a "normal" Problem of a loop with Counter ...
but i have not found Solution yet :(

who have the right Way for this Problem :?:
Es difícil reproducir el error con esas lineas de código que indicas. A mi los bucles me funcionan bien.
Saludos

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 12:42 pm
by serge_girard
aRows [iii] [nnn]

nnn is 1 to 3
what is iii ?

S

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 12:53 pm
by danielmaximiliano
serge_girard wrote: Tue Feb 08, 2022 12:42 pm aRows [iii] [nnn]

nnn is 1 to 3
what is iii ?

S
you must use msgdebug with the found variables to see their content

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 1:14 pm
by serge_girard
Jimmy,

Maybe send complete PRG to the forum?
Serge

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 2:41 pm
by AUGE_OHR
hi,

Source is

Code: Select all

c:\hmg.3.4.4\SAMPLES\Controls\ReportAdvanced\REPORT_ADVANCED_8\ 
which use *.RMG and Array

i have change i to iii "just" to see what happens
i have "integrate" demo.RMG into demo.PRG and try to make a loop

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 4:26 pm
by serge_girard
got it!

In PRG:

Code: Select all

	Public i := 1
	Public n := 1
				ITEM 'Execute Report'	ACTION ( n:= 1, i := 1 , ExecuteReport('Demo',.t.,.t. ) )

  
in RMG:

Code: Select all

	BEGIN DATA
		ITERATOR	n++
		STOPPER		n == 3 
		ITERATOR	i++
		STOPPER		i == 20 
	END DATA


		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


  

Re: REPORT "on-fly" ?

Posted: Tue Feb 08, 2022 4:48 pm
by AUGE_OHR
hi,

GREAT Work !

in *.RMG file there are 3 x

Code: Select all

   BEGIN TEXT
      EXPRESSION aRows [i] [n]
      ...
   END TEXT
is it possible to reduce "that" also i a loop when import *.RMG Source (like *.FMG) into *.PRG :?: