Relacionar 2 Arrays é possível com FastReport?

231 views
Skip to first unread message

UJS

unread,
Aug 12, 2013, 4:30:34 PM8/12/13
to fastreport_f...@googlegroups.com
Utilizando fastreport é possível relacionar 2 arrays?

utilizando tabela faço assim:

oFast:SetMasterDetail( 'cliente', 'cidade', { || cliente->cidade } )

mais e com array?

Reinaldo Crespo

unread,
Aug 13, 2013, 8:33:48 AM8/13/13
to fastreport_f...@googlegroups.com
You would have to relate both arrays manually via a codeblock on a SetUserDataSet().  Here is some code to show you how:

LOCAL nAt, x, bResync
...

   bResync := { | n | x := aArrayData[ n, 5 ] ,;
oFrh:Resync( “ArrayData2” ) }


      :SetUserDataSet( “ArrayData", cFlds, ;
                     { || nAt := 1, EVAL( bResync, nAt )  },;
                     { || nAt++, EVAL( bResync, nAt ) },;
                     { || nAt--, EVAL( bResync, nAt ) },;
                     { || nAt > LEN( aArrayData ) },;
                     { |cFld| iif( cFld == ‘FIELD1”, aArrayData[ nAt, 1 ]  .....  } )

:SetResyncPair( “ArrayData, “ArrayData2” )


bResync will set the value on x which you should use on :setUserDataSet( “ArrayData2”....  So each ArrayData will behave like the Parent of ArrayData2.  By using a bResync codeblock, you can actually control any situation with any type of data including xBrowses (EVAL( oBrw:bBookMark, n ) ), arrays, SQL cursors, etc...

Hope that helps,





Reinaldo Crespo-Bazán



--
You received this message because you are subscribed to the Google Groups "FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fastreport_for_x_h...@googlegroups.com.
To post to this group, send email to fastreport_f...@googlegroups.com.
Visit this group at http://groups.google.com/group/fastreport_for_x_harbour.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ubiratan ubiratan

unread,
Aug 13, 2013, 8:59:12 AM8/13/13
to fastreport_f...@googlegroups.com
Reinaldo,

Muito obrigado


2013/8/13 Reinaldo Crespo <reinald...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fastreport_for_x_harbour/8RP12gqhRKg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fastreport_for_x_h...@googlegroups.com.

To post to this group, send email to fastreport_f...@googlegroups.com.
Visit this group at http://groups.google.com/group/fastreport_for_x_harbour.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
-
  Ubiratan José dos Santos

  Coordenador de Projetos
  SG Sistemas de Automação LTDA
  Fone: (44) 3026-2666


Reply all
Reply to author
Forward
0 new messages