View Full Version : Export to PDF problem
Clayton
13-Jul-2010, 11:57 AM
Hi,
See attachments.
I'm trying to export a report to pdf from a "Dynamic Preview View" created by the wizard. I saw others threads talking about set export options in oReport object, but I can't do that (I guess) because the oReport object is created dynamically in cVRWReportView.
I got the "new" cVisualReport.pkg available from a thread to Rafael, and also, I filled all the fields at "Enter/Select Export Options" dialog loaded from my "Dynamic Preview View".
Am I missing something here or is this a bug?
Vincent Oorsprong
14-Jul-2010, 01:12 AM
Clayton,
Please show us the code you use to start the export. The export options are important and can be the cause of a GPF but the latest packages should avoid that. When exporting from the preview it all should work fine.
Clayton
14-Jul-2010, 06:30 AM
Is StartReport procedure what you mean?
Procedure StartReport
Integer eOutputDevice iDetalharItens
Handle hoClientArea hoView
Boolean bOk
String sReportName sReportID sFilterFunction sOcultarItens
Date dInicio dFim
Get Value of oInicio_Frm to dInicio
Get Value of oFim_Frm to dFim
Get Checked_State of oDetalharItens_Chk to iDetalharItens
Move ('return'*If (iDetalharItens=1,'0','1')) to sOcultarItens
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{BST013.DATA} >= DateSerial (" + String (DateGetYear (dInicio)) + "," + String (DateGetMonth (dInicio)) + "," + String (DateGetDay (dInicio)) + ")") to sFilterFunction
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{BST013.DATA} <= DateSerial (" + String (DateGetYear (dFim)) + "," + String (DateGetMonth (dFim)) + "," + String (DateGetDay (dFim)) + ")") to sFilterFunction
Move "Bst013.vrw" to sReportName
Get Output_Device_Mode to eOutputDevice
If (eOutputDevice = PRINT_TO_WINDOW) Begin
Get Client_Id to hoClientArea
If (hoClientArea <> 0) Begin
Get Create of hoClientArea (RefClass (cVRWReportView)) to hoView
If (sFilterFunction <> "") Begin
Set psFilterFunction of hoView to ("Return" * sFilterFunction)
End
Set psReportFileName of hoView to sReportName
Set psFunction of hoView sReportID 'Subtitulo' to ('return "Periodo:'*String(dInicio)*'a'*String(dFim)+'"')
Set psFunction of hoView sReportID 'Ocultar itens' to sOcultarItens
Send StartReport of hoView
End
End
Else Begin
Get OpenReport of oVRWPreviewPanel sReportName to bOk
If (bOk) Begin
Set peOutputDestination of oVRWPreviewPanel to eOutputDevice
If (sFilterFunction <> "") Begin
Set psFilterFunction of oVRWPreviewPanel to ("Return" * sFilterFunction)
End
Set psFunction of oReport sReportName 'Subtitulo' to ('return "Período:'*String(dInicio)*'a'*String(dFim))
Send StartReport of oVRWPreviewPanel
End
End
End_Procedure
Thanks
Vincent Oorsprong
14-Jul-2010, 08:03 AM
Clayton,
That looks good to me, I tested with a similar situation, not with the psFunction though. Could you see if you can export from Visual Report Writer itself, what happens when you take out the psFunction settings?
Clayton
14-Jul-2010, 09:35 AM
Both doesn't work, VRW and my app without the psFunction. :(
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.