FastReport - Fechar Preview ao clicar BUTTON Print

354 views
Skip to first unread message

UJS

unread,
May 31, 2013, 10:56:48 AM5/31/13
to fastreport_f...@googlegroups.com
Pessoal,

É possível tratar ação do button PRINT do Preview? Ou seja, ao clicar no botão PRINT ele fechar o PREVIEW sem imprimir.


Reinaldo Crespo

unread,
May 31, 2013, 11:05:02 AM5/31/13
to fastreport_f...@googlegroups.com
Is this what you are looking for?


      :SetEventHandler( "Report", "OnAfterPrintReport", { || SomeHarbourFunction( Parameter1 ) } )



Reinaldo Crespo-Bazán



On May 31, 2013, at 10:56 AM, UJS wrote:

Pessoal,

É possível tratar ação do button PRINT do Preview? Ou seja, ao clicar no botão PRINT ele fechar o PREVIEW sem imprimir.



--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ubiratan ubiratan

unread,
May 31, 2013, 12:47:31 PM5/31/13
to fastreport_f...@googlegroups.com
Reinaldo, obrigado por responder,

Preciso que ao clicar no botão PRINT(preview):

em vez de aparecer as impressoras e imprimir, que ele gere o arquivo em uma pasta(exportando)

ou

que  ao clicar no botao PRINT ele feche o preview sem imprimir e depois eu faço o tratamento para gerar o arquivo na pasta desejada(exportando)

Como funcionaria este codigo:

: SetEventHandler ("Relatório", "OnAfterPrintReport", {| | SomeHarbourFunction (Parâmetro1)})

Como eu deveria usa-lo?


Muito Obrigado

Ubiratan J Santos




2013/5/31 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/gIhocnpWrk4/unsubscribe?hl=en.
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?hl=en.
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


Reinaldo Crespo

unread,
May 31, 2013, 1:11:24 PM5/31/13
to fastreport_f...@googlegroups.com

Hola Ubriatan;



On May 31, 2013, at 12:47 PM, ubiratan ubiratan wrote:

Reinaldo, obrigado por responder,

Preciso que ao clicar no botão PRINT(preview):

em vez de aparecer as impressoras e imprimir, que ele gere o arquivo em uma pasta(exportando)

ou

que  ao clicar no botao PRINT ele feche o preview sem imprimir e depois eu faço o tratamento para gerar o arquivo na pasta desejada(exportando)


Lo siento que no entiendo completamente lo que quieres decir aquí arriba :-(


Como funcionaria este codigo:

: SetEventHandler ("Relatório", "OnAfterPrintReport", {| | SomeHarbourFunction (Parâmetro1)})

Como eu deveria usa-lo?

Cuando el usuario hace click en el botón de imprirmir, entonces FastReports ejecuta el codeblock.  Por ejemplo:

:SetEventHandler( “Report”, “OnAfterPrintReport”, { || MsgInfo( “Hello world” ) } )

Entonces cuando el usuario imprime el reporte el mensaje Hello world sale en pantalla.   El codeblock puede en vez de ser MsgInfo() ser una función interna en tu programa que crea el export que quieres.


Otra cosa que puedes hacer es asignar un codeblock a un doble-click en cualquier objeto en el preview del reporte usando código.  Vas a la pestaña de Events del objeto y haces doble click en el evento OnPreviewDblClick.  Luego en code escribes algo así:

//---------------------------------------------                                                                                                  
procedure Memo1OnPreviewDblClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
begin

          CallHbFunc( 'MarkAsSigned',[<cSomeVar>] );

          Modified := TRUE ;
         
end;

MarkAsSigned debe ser una función en tu programa que recibe un parámetro.

Hope that helps,


Reinaldo.




Muito Obrigado

Ubiratan J Santos




2013/5/31 Reinaldo Crespo <reinald...@gmail.com>
Is this what you are looking for?


      :SetEventHandler( "Report", "OnAfterPrintReport", { || SomeHarbourFunction( Parameter1 ) } )



Reinaldo Crespo-Bazán



On May 31, 2013, at 10:56 AM, UJS wrote:

Pessoal,

É possível tratar ação do button PRINT do Preview? Ou seja, ao clicar no botão PRINT ele fechar o PREVIEW sem imprimir.



--
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_harbour+unsubscribe@
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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/gIhocnpWrk4/unsubscribe?hl=en.
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?hl=en.
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


ubiratan ubiratan

unread,
May 31, 2013, 1:26:44 PM5/31/13
to fastreport_f...@googlegroups.com
Cuando el usuario hace click en el botón de imprirmir, entonces FastReports ejecuta el codeblock.  Por ejemplo:

:SetEventHandler( “Report”, “OnAfterPrintReport”, { || MsgInfo( “Hello world” ) } )

Entonces cuando el usuario imprime el reporte el mensaje Hello world sale en pantalla.   El codeblock puede en vez de ser MsgInfo() ser una función interna en tu programa que crea el export que quieres.

Seria possível não imprimir(NOT PRINT) e apenas  ( crea el export ) ?

Muito obrigado

Ubiratan J Santos

Wanderson Peixoto

unread,
May 31, 2013, 1:31:53 PM5/31/13
to fastreport_f...@googlegroups.com
Ubiratan faz assim:

FrPrn := frReportManager():new()
FrPrn:SetTitle("Teste")
FrPrn:SetWorkArea("ARQCTO", Select("ARQCTO"))
FrPrn:SetResyncPair("ARQCTO")
FrPrn:LoadFromFile("xDacte.FR3")
DirWin  := DirWin+"\TESTE.PDF"
FrPrn:SetProperty("PDFExport", "FileName", DirWin)
FrPrn:SetProperty("PDFExport", "OpenAfterExport", .f.)
FrPrn:SetProperty("PDFExport", "ShowDialog",.f.)
FrPrn:PrepareReport()
FrPrn:DoExport("PDFExport")
FrPrn:DestroyFR()

Assim ele vai exportar para pdf onde vc especificar e não vai exibir o relatório.

Att.
Wanderson.

Date: Fri, 31 May 2013 14:26:44 -0300
Subject: Re: FastReport - Fechar Preview ao clicar BUTTON Print
From: ubir...@sgsistemas.com.br
To: fastreport_f...@googlegroups.com

ubiratan ubiratan

unread,
May 31, 2013, 1:42:38 PM5/31/13
to fastreport_f...@googlegroups.com
Wanderson,

Preciso que o usuário veja o PREVIEW, mais quando o mesmo CLICAR EM PRINT, em vez de pedir a impressora o FARTREPORT pudesse exportar.

Sei que talvez isso não seja possível. Caso não seja possível, gostaria de: 

Quando o usuario CLICAR em PRINT o FAST REPORT feche o preview, e, em seguida eu gero a exportar novamente.

Obrigado por ter respondido

Ubiratan J Santos



2013/5/31 Wanderson Peixoto <w_pe...@hotmail.com>

Wanderson Peixoto

unread,
May 31, 2013, 1:44:49 PM5/31/13
to fastreport_f...@googlegroups.com
O que vc pode tentar é colocar:

FrPrn:SetProperty("PDFExport", "OpenAfterExport", .t.)

Que vai abrir depois de exportar, aí basta o usuário fechar.

Flw.


Date: Fri, 31 May 2013 14:42:38 -0300

Reinaldo Crespo

unread,
May 31, 2013, 1:46:15 PM5/31/13
to fastreport_f...@googlegroups.com
Que tal si en vez de DestroyFr() Insertas oFrPrn:ShowReport()   De esta manera has creado el export y luego abres el preview.  



Reinaldo Crespo-Bazán


ubiratan ubiratan

unread,
May 31, 2013, 1:52:55 PM5/31/13
to fastreport_f...@googlegroups.com
Reinaldo e Wanderson ...

MUITO OBRIGADO, vou realizar alguns testes e provar a melhor alternativa.

Muito obrigado!

Ubiratan J Santos
Reply all
Reply to author
Forward
0 new messages