Jump to content
Fivewin Brasil

FastReport com Array


SAOliveira

Recommended Posts

E ai Alessandro blz, colega a pouco tempo atrás vc postou como usar os código abaixo em array, mais não consigo achar o tópico nem a pau, e não tem nenhuma outra fonte com isto, se possível vc poderia postar o link do tópico ou a solução...

oFrPrn:SetMasterDetail("relven5a", "relven5c", {||relven5a->pedido})

oFrPrn:SetResyncPair( "relven5a", "relven5c" )

Vlw Obrigado

Luiz Fernando

Link to comment
Share on other sites

   aAdd(::aFields,"CAMPO1")  //-- 01
   aAdd(::aFields,"CAMPO2")   //-- 02
   aAdd(::aFields,"CAMPO3")     //-- 03
   aAdd(::aFields,"CAMPO4")    //-- 04
   
   For i = 1 to Len(::aFields)
   
      cCampos += ::aFields[i] + If( i + 1 > Len(::aFields),"", ";")
      
   end

   cAux := '{|aField| xx := '

   For i = 1 to Len(::aFields)

      cAux += 'If(aField = "'
      cAux += ::aFields[i]
      cAux += '",'
      cAux += AllTrim(Str(i))

      If I + 1 >= Len(::aFields)

         cAux += ','
         cAux += AllTrim(Str(i+1))
         cAux += Replicate(")",i)

         exit

      else

         cAux += ","

      end

   end

   cAux += ', aValFastReport[nRec, xx]}'

   bAux := &( cAux )

   Result := ::oFrPrn:SetUserDataSet( "MEUARRAY",;
                                       cCampos,;
                                    {||nRec := 1},;
                                    {||nRec := nRec + 1},;
                                    {||nRec := nRec - 1},;
                                    {||nRec > Len(aValFastReport)},;
                                       bAux)
::oFrPrn:SetProperty("Principal","DataSetName","MEUARRAY")

 

Ta ae um exemplo, só precisa adaptar pra sua realidade ae ;)

Obs.: aValFastResport é uma variável private ou pública ( eu uso como pública )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...