Page 1 of 1

print a array

PostPosted: Thu Jul 08, 2021 9:27 pm
by Silvio.Falconi
I saw print01.prg I wish print an array
How converte my adata into this format

I take thea data with

aRighe:= oRigheInvoice:DbfToArray( cItemFlds, { || FIELD->Invoice ==alltrim(nInvoice) } )
for n= 1 to len(arighe)
aadd( aItems,aRighe[n])
next
aData:= aItems

@ 13.0, 2.0 PRINT TO oPrn TABLE aData SIZE 7.0, 4.0 CM TITLE "Services" BORDER

I have this error
Code: Select all  Expand view
  Args:
     [   1] = N   1

Stack Calls
===========
   Called from:  => LEN( 0 )
   Called from: .\source\classes\TARRDATA.PRG => (b)AUTOSTRUCT( 2425 )
   Called from:  => AEVAL( 0 )
   Called from: .\source\classes\TARRDATA.PRG => AUTOSTRUCT( 2425 )
   Called from: .\source\classes\TARRDATA.PRG => STR2STRUCT( 2372 )
   Called from: .\source\classes\TARRDATA.PRG => TARRAYDATA:NEW( 244 )
   Called from: .\source\classes\PRINTER.PRG => TPRINTER:PRINTTABLE( 1277 )
   Called from: test.prg => STAMPA_RICEVUTA( 253 )
   Called from: test.prg => MAIN( 32 )

Re: print a array

PostPosted: Fri Jul 09, 2021 11:31 pm
by nageswaragunupudi
This happens when all items in a column of the array are not of the same type.
Try
Code: Select all  Expand view
@ 13.0, 2.0 PRINT TO oPrn TABLE aRighe SIZE 7.0, 4.0 CM TITLE "Services" BORDER
 

and see if this works correctly.

Re: print a array

PostPosted: Sat Jul 10, 2021 10:19 am
by Silvio.Falconi
yes it run
I must make it on hand

I need this
Image

I made it on hand @x,y

Re: print a array

PostPosted: Sat Jul 10, 2021 3:08 pm
by Otto
Silvio,

Best regards,
Otto

Image

Code: Select all  Expand view


 AADD( aReport , {  "Clip2.jpg",    "Ombrellone 0006","1", "9.00""9.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00"  } )
        AADD( aReport , {  "Clip3.jpg""Lettino",          "1", "5.00", "5.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00" } )
        AADD( aReport , {  "Clip4.jpg""Sdraio",           "2", "6.00", "6.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00" } )

        cHtml += cTextIni
        cText += "<table style='width:100%'>" + CRLF
        cText += "<tr>" + CRLF
        cText += check4prn( 1,"<th>Ico</th>" + CRLF )
        cText += check4prn( 2,"<th>Descrizione</th>" + CRLF )
        cText += check4prn( 3,"<th>Qt.</th>" + CRLF )
        cText += check4prn( 4,"<th>Unit.</th>" + CRLF )
        cText += check4prn( 5,"<th>ToxQt</th>" + CRLF )
        cText += check4prn( 6,"<th>Dal</th>" + CRLF )
        cText += check4prn( 7,"<th>Al</th>" + CRLF )
        cText += check4prn( 8,"<th>Giorni</th>" + CRLF )
        cText += check4prn( 9,"<th>Sconto</th>" + CRLF )
        cText += check4prn( 10,"<th>Totale riga</th>" + CRLF )
        cText += "</tr>" + CRLF

        cHtml += cText
        FOR I := 1 to len(aReport)                          
            cText := "<tr>" + CRLF
            cText   += check4prn( 1,"<td class='mytd'><IMG SRC='beach/" + aReport[I,1] +  "' NAME='Grafik1' ALIGN=BOTTOM WIDTH=37 HEIGHT=37 BORDER=0></td>" + CRLF )
            cText   += check4prn( 2,"<td class='mytd'>" + aReport[I,2]  + "</td>" + CRLF )
            cText   += check4prn( 3,"<td class='mytd'>" + aReport[I,3] + "</td>" + CRLF )
            cText   += check4prn( 4,"<td class='mytd'>" + aReport[I,4] + "</td>" + CRLF )
            cText   += check4prn( 5,"<td class='mytd'>" + aReport[I,5] + "</td>" + CRLF )
            cText   += check4prn( 6,"<td class='mytd'>" + aReport[I,6] + "</td>" + CRLF )
            cText   += check4prn( 7,"<td class='mytd'>" + aReport[I,7] + "</td>" + CRLF )
            cText   += check4prn( 8,"<td class='mytd'>" + aReport[I,8] + "</td>" + CRLF )            
            cText   += check4prn( 9,"<td class='mytd'>" + aReport[I,9] + "</td>" + CRLF )            
            cText   += check4prn( 10,"<td class='mytd'>" + aReport[I,10] + "</td>" + CRLF )            
            cText += "</tr>" + CRLF
            cHtml += cText
        next                              
        cHtml += "</table> "

 

Re: print a array

PostPosted: Sat Jul 10, 2021 3:17 pm
by Silvio.Falconi
Otto wrote:Silvio,

Best regards,
Otto

Image

Code: Select all  Expand view


 AADD( aReport , {  "Clip2.jpg",    "Ombrellone 0006","1", "9.00""9.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00"  } )
        AADD( aReport , {  "Clip3.jpg""Lettino",          "1", "5.00", "5.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00" } )
        AADD( aReport , {  "Clip4.jpg""Sdraio",           "2", "6.00", "6.00", "08-Lug-2021""08-Lug-2021","" , "0.00",  "0.00" } )

        cHtml += cTextIni
        cText += "<table style='width:100%'>" + CRLF
        cText += "<tr>" + CRLF
        cText += check4prn( 1,"<th>Ico</th>" + CRLF )
        cText += check4prn( 2,"<th>Descrizione</th>" + CRLF )
        cText += check4prn( 3,"<th>Qt.</th>" + CRLF )
        cText += check4prn( 4,"<th>Unit.</th>" + CRLF )
        cText += check4prn( 5,"<th>ToxQt</th>" + CRLF )
        cText += check4prn( 6,"<th>Dal</th>" + CRLF )
        cText += check4prn( 7,"<th>Al</th>" + CRLF )
        cText += check4prn( 8,"<th>Giorni</th>" + CRLF )
        cText += check4prn( 9,"<th>Sconto</th>" + CRLF )
        cText += check4prn( 10,"<th>Totale riga</th>" + CRLF )
        cText += "</tr>" + CRLF

        cHtml += cText
        FOR I := 1 to len(aReport)                          
            cText := "<tr>" + CRLF
            cText   += check4prn( 1,"<td class='mytd'><IMG SRC='beach/" + aReport[I,1] +  "' NAME='Grafik1' ALIGN=BOTTOM WIDTH=37 HEIGHT=37 BORDER=0></td>" + CRLF )
            cText   += check4prn( 2,"<td class='mytd'>" + aReport[I,2]  + "</td>" + CRLF )
            cText   += check4prn( 3,"<td class='mytd'>" + aReport[I,3] + "</td>" + CRLF )
            cText   += check4prn( 4,"<td class='mytd'>" + aReport[I,4] + "</td>" + CRLF )
            cText   += check4prn( 5,"<td class='mytd'>" + aReport[I,5] + "</td>" + CRLF )
            cText   += check4prn( 6,"<td class='mytd'>" + aReport[I,6] + "</td>" + CRLF )
            cText   += check4prn( 7,"<td class='mytd'>" + aReport[I,7] + "</td>" + CRLF )
            cText   += check4prn( 8,"<td class='mytd'>" + aReport[I,8] + "</td>" + CRLF )            
            cText   += check4prn( 9,"<td class='mytd'>" + aReport[I,9] + "</td>" + CRLF )            
            cText   += check4prn( 10,"<td class='mytd'>" + aReport[I,10] + "</td>" + CRLF )            
            cText += "</tr>" + CRLF
            cHtml += cText
        next                              
        cHtml += "</table> "

 



I knew it. I had no doubt. that Otto came up with the web.
Stop mr Otto stop i wish use fwh no web

Re: print a array

PostPosted: Sat Jul 10, 2021 4:23 pm
by Otto
Silvio,
This is FWH only, the report definition language is HTML and CSS.

Best regards,
Otto

Re: print a array

PostPosted: Sat Jul 10, 2021 4:59 pm
by Silvio.Falconi
sorry,
no html and web
I really don't know how to make you understand that I don't care about the printout with html, web and mod_harbour, what should I do to make you understand?

Re: print a array

PostPosted: Sat Jul 10, 2021 5:10 pm
by Otto
Silvio,
You don't have to worry about the web. This is Fivewin.

Best regards,
Otto

Image

Re: print a array

PostPosted: Sat Jul 10, 2021 5:42 pm
by Otto
Silvio,
The "beach" example is the replacement for oReport.
But you can also work directly with Word. It depends on the reports you need.
Best regards,
Otto

Image

Image
Image

Re: print a array

PostPosted: Sun Jul 11, 2021 5:35 pm
by Massimo Linossi
Only a curiosity.
Silvio, you are asking about umbrellas since 3 or 4 years, or more, I lost count.
The program that are you making is for all Miami beach ? Because in all this time
a normal programmer can make a procedure for going to Mars. Not me, of course,
I've never made a class for FWH and I'm not able to write code.
Peace and love
Massimo

Re: print a array

PostPosted: Sun Jul 11, 2021 6:17 pm
by Silvio.Falconi
first of all I did not understand your interest, on the other hand I do not speak to people like you who have not produced and proposed any object class but are offended to go go, I'm tired of your insolent messages,

if I'm working for 4 years you must not care after all you never gave me help but only offenses after offenses. Maybe it's the heat that made you come out of your shell but I don't intend to respond to your offenses.

People like you have ruined the fivewins, I in my small way have created some classes and I have contributed to the community. What did you do Massimo?

you can only instigate a fight, are you a troll?

because that's the only way people like you are defined, have a nice day

Re: print a array

PostPosted: Sun Jul 11, 2021 8:06 pm
by leandro
Amigo otto buenas tardes,

Que pena integrarme a la conversación, pero a mi si me gustaría probar el generador de reportes html, pero no logro encontrar el ejemplo para hacer uso de este con harbour/xharbour.

Podrías publicarlo?

De antemano gracias,

Re: print a array

PostPosted: Sun Jul 11, 2021 11:21 pm
by Silvio.Falconi
leandro wrote:Amigo otto buenas tardes,

Que pena integrarme a la conversación, pero a mi si me gustaría probar el generador de reportes html, pero no logro encontrar el ejemplo para hacer uso de este con harbour/xharbour.

Podrías publicarlo?

De antemano gracias,



please I asked another topic,
please leandro I had asked another topic, I did not ask to make a report with html but how use the PRINT TABLE command. Now Otto linossi are exaggerating I can no longer tolerate this situation