REPORT "on-fly" ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

REPORT "on-fly" ?

Post 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:
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: REPORT "on-fly" ?

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: REPORT "on-fly" ?

Post 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 :?:
have fun
Jimmy
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: REPORT "on-fly" ?

Post 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
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: REPORT "on-fly" ?

Post by serge_girard »

aRows [iii] [nnn]

nnn is 1 to 3
what is iii ?

S
There's nothing you can do that can't be done...
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: REPORT "on-fly" ?

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: REPORT "on-fly" ?

Post by serge_girard »

Jimmy,

Maybe send complete PRG to the forum?
Serge
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: REPORT "on-fly" ?

Post 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
have fun
Jimmy
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: REPORT "on-fly" ?

Post 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


  
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: REPORT "on-fly" ?

Post 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 :?:
have fun
Jimmy
Post Reply