Page 1 of 2

ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 7:39 am
by Silvio.Falconi
On My application there is this error
but only on a Function when I try to print an array with report class

type : aBilancio[x,x]

1. error the menu is big lines
2. the menu have 2007 style

Image

this is my function use Treport

where is the error ?


Code: Select all  Expand view


Function Report_Nuovo_Bilancio_Trimestre(aBilancio)
            Local  i:= 1
            Local oReport
            Local cTitulo1 := "Bilancio Annuale"
            Local cTitulo2 := "Esercizio " +rtrim(oApp:cYearPath)
            Local cTitulo3 := IIF(!EMPTY(cDevActivitad),"["+cDevActivitad+"]","["+"Tutte le attività"+"]")
            Local oFont1
            Local oFont2
            Local oFont3
            Local oFont4
            Local oPen1,oPen2
            Local cFooter


   


     DEFINE PEN oPen1 WIDTH 2 COLOR CLR_HGRAY
     DEFINE PEN oPen2 WIDTH 1 COLOR CLR_HGRAY


     DEFINE FONT oFont1 NAME "Courier New" SIZE 0,-10
     DEFINE FONT oFont2 NAME "Courier New" SIZE 0,-10
     DEFINE FONT oFont3 NAME "Courier New" SIZE 0,-10

       oFont4 := TFont():New( "ARIAL", 0, -69,,,220,,,,,,,,,, oReport, ) // per scritta protezione





         REPORT oReport ;
         TITLE  " ",cTitulo1,cTitulo2,iif(cTitulo3!=NIL,cTitulo3," ") CENTERED;
         FONT   oFont1, oFont2, oFont3 ,oFont4;
          PEN    oPen1, oPen2 ;
         HEADER ' ', oApp():cAppName+oApp():cVersion, cFooter   ;
         FOOTER cFooter, "Data: "+dtoc(date())+ "   Pagina.: "+str(oReport:nPage,3) ;
         CAPTION oApp():cAppName+oApp():cVersion PREVIEW





          COLUMN TITLE "Causale " ;
              DATA aBilancio[i,1] ;
              SIZE 30  GRID 2

       /* COLUMN TITLE "" ;
              DATA aBilancio[i,2] ;
              SIZE 25 */


          COLUMN TITLE "Primo Trimestre " ;
              DATA aBilancio[i,2] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2

           COLUMN TITLE "Secondo Trimestre " ;
              DATA aBilancio[i,3] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2

            COLUMN TITLE "Terzo Trimestre " ;
              DATA aBilancio[i,4] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT  GRID 2

             COLUMN TITLE "Quarto Trimestre " ;
              DATA aBilancio[i,5] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2


             COLUMN TITLE "Totale Annuale  " ;
              DATA aBilancio[i,6] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT    ;
               GRID 2




             GROUP ON aBilancio[i,1];
             HEADER "" ;
             FOOTER ""


       END REPORT

      oReport:bSkip := {|| i++  }
      oReport:bInit := {|| i := 1 }

         oReport:lJoin :=  .T.

      ACTIVATE REPORT oReport WHILE i <= LEN( aBilancio )
             


     oFont1:End()
     oFont2:End()
     oFont3:End()
     oFont4:End()
     oPen1:End()
     oPen2:End()
   RETURN nil
//----------------------------------------------------------------------------------//
 

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 9:10 am
by Antonio Linares
Dear Silvio,

Please provide a self contained PRG, to copy, paste and build it so tech support goes faster :-)

many thanks

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 9:20 am
by Silvio.Falconi
SOMEONE CHANGED MENU CLASS


this error not come allways but sometimes
on that function I use ten dbfs and make many operations to save balance on a array
How I can make a smal test for you ?
On oldest release of fwh run ok same source codes I convert it on February 2017 and there are problems

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 9:41 am
by gkuhnert
Antonio, Silvio,

some variable defitinions obviously come from outside but are just being used for titles.
I quickly made a sample, a Bilancio is just a small array now!



Code: Select all  Expand view


#include "FiveWin.ch"
#include "report.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oWndEdit, oBar, oIcon, oImage
   local cName := "FiveWin power"

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE "I am the MDI Frame" ;
      MDI ;
      MENU BuildMenu() ; // COLOR "GR+*/RB"
      ICON oIcon

   SET MESSAGE OF oWnd TO "Startfenster CTO Testumgebung"

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Program"
      MENU
            MENUITEM "&Report" ACTION Report_Nuovo_Bilancio_Trimestre()
         SEPARATOR
         MENUITEM "&End..." ACTION oWnd:End()
      ENDMENU

   ENDMENU

return oMenu

//----------------------------------------------------------------------------//

Function Report_Nuovo_Bilancio_Trimestre()
   Local  i:= 1
   Local oReport
   Local cTitulo1 := "Bilancio Annuale"
   Local cTitulo2 := "Esercizio "
   Local cTitulo3 := "Titulo 3"
   Local oFont1
   Local oFont2
   Local oFont3
   Local oFont4
   Local oPen1,oPen2
   Local cFooter
    local aBilancio

        aBilancio := {;
            {"a", 5, 10, 20, 22, 37},;
            {"a", 4, 12, 25, 24, 33},;
            {"b", 3, 13, 24, 52, 34},;
            {"b", 7, 16, 21, 32, 1},;
            {"c", 8, 11, 22, 22, 12};
        }

     DEFINE PEN oPen1 WIDTH 2 COLOR CLR_HGRAY
     DEFINE PEN oPen2 WIDTH 1 COLOR CLR_HGRAY

     DEFINE FONT oFont1 NAME "Courier New" SIZE 0,-10
     DEFINE FONT oFont2 NAME "Courier New" SIZE 0,-10
     DEFINE FONT oFont3 NAME "Courier New" SIZE 0,-10

     oFont4 := TFont():New( "ARIAL", 0, -69,,,220,,,,,,,,,, oReport, ) // per scritta protezione

         REPORT oReport ;
         TITLE  " ",cTitulo1,cTitulo2,iif(cTitulo3!=NIL,cTitulo3," ") CENTERED;
         FONT   oFont1, oFont2, oFont3 ,oFont4;
         PEN    oPen1, oPen2 ;
         HEADER ' ', "header", cFooter   ;
         FOOTER cFooter, "Data: "+dtoc(date())+ "   Pagina.: "+str(oReport:nPage,3) ;
         CAPTION "caption" PREVIEW

          COLUMN TITLE "Causale " ;
              DATA aBilancio[i,1] ;
              SIZE 30  GRID 2

       /* COLUMN TITLE "" ;
              DATA aBilancio[i,2] ;
              SIZE 25 */


          COLUMN TITLE "Primo Trimestre " ;
              DATA aBilancio[i,2] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2

           COLUMN TITLE "Secondo Trimestre " ;
              DATA aBilancio[i,3] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2

            COLUMN TITLE "Terzo Trimestre " ;
              DATA aBilancio[i,4] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT  GRID 2

             COLUMN TITLE "Quarto Trimestre " ;
              DATA aBilancio[i,5] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT   GRID 2


             COLUMN TITLE "Totale Annuale  " ;
              DATA aBilancio[i,6] ;
              picture "999,999.99"  ;
               SIZE 20 ;
                FONT 2             ;
               RIGHT    ;
               GRID 2




             GROUP ON aBilancio[i,1];
             HEADER "" ;
             FOOTER ""


       END REPORT

      oReport:bSkip := {|| i++  }
      oReport:bInit := {|| i := 1 }

         oReport:lJoin :=  .T.

      ACTIVATE REPORT oReport WHILE i <= LEN( aBilancio )



     oFont1:End()
     oFont2:End()
     oFont3:End()
     oFont4:End()
     oPen1:End()
     oPen2:End()
   RETURN nil
 

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 9:56 am
by Silvio.Falconi
I tried also I and on test not make error I tried with Local aBilancio:=array(10,6)

For My application I compiled with fwh 15 and there was not error
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20140725)
FiveWin Version: FWHX 15.01

I compile with Feb 17 make error

not depend from array abilancio

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 9:58 am
by gkuhnert
I tried with FHW1706 and BCC7 + xHarbour (1.2.3.10172, 18.12.2016), no error. I also tried with FWH1706 and MSVC2017 + harbour (20170325), no error too!

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:04 am
by cnavarro
Silvio
Try with this and comment

viewtopic.php?f=3&t=34262&start=0

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:04 am
by Silvio.Falconi
I insert your array before the REPORT COMMAND on my application and you must see what happen ....



Image

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:06 am
by Silvio.Falconi
cnavarro wrote:Silvio
Try with this and comment

viewtopic.php?f=3&t=34262&start=0


I allready tried with these modificatins

MENU oMenu

oMenu:l2007 := ( nStyle == 2007 )
oMenu:l2010 := ( nStyle == 2010 )
oMenu:l2013 := ( nStyle == 2013 )
oMenu:l2015 := ( nStyle == 2015 )

oMenu:lMenuBar := .T.

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:13 am
by cnavarro
Silvio
I'll try with your version
Please wait

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:16 am
by Silvio.Falconi
I treied to move these functions on another new file prg

Nuovo_Bilancio_Trimestre(lSaldo,oGrid)

Report_Nuovo_Bilancio_Trimestre(aBilancio)

but I have the same error

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 10:52 am
by Silvio.Falconi
Stop
Perhaps I found the error


I rem all the first function where I create the array and now run ok

Now I 'm searching the error on my function ...it's very strange !!!

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 11:23 am
by Silvio.Falconi
NO I not found the errror on my function ... there is no logic error

I not call any functions of menu of Rpreview or commans or obj of Menuitem or menu.prg casses

I use my variables

I really not understood!!!!

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 1:32 pm
by Silvio.Falconi
now I made a test with only that functions and run ok

I 'm thinking it cannot be an error from my sources but somthing U changed on menu class

Re: ERROR ON RPREVIEW

PostPosted: Wed Jul 19, 2017 1:49 pm
by Silvio.Falconi
Dear Antonio, Cristobal, Gilbert

I compiled with January 2015 and it run ok

Image


you changed something to menu or menuitem classes or another class , I am sure now !!!