PDA

View Full Version : Setting Report Properties from a "ReportView"



Michael Mullan
24-May-2010, 04:23 PM
Vincent, &co,

When you use the defaults on the integration wizard to create your reportview, you get code like this
Procedure StartReport
Integer eOutputDevice
Handle hoClientArea hoView
String sReportName
Boolean bOk
String sFilterFunction

Move "InsuranceStatement.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 com Properties of report here?
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 com Properties of report here? Also? Instead?
Send StartReport of oVRWPreviewPanel
End
End
End_Procedure

I'm just not sure yet where to set the properties I need of the actual report yet. In this case, I'm using a temp file as the top most file in the report, so I need to redirect its datasource.

I'd be much more comfortable if the code created by the wizard had a clear indication of when the report object is created, and ready for us to mess with it before it is actually run.

MM.

Bob Worsley
24-May-2010, 09:01 PM
Wouldn't OnInitializeReport be the place?

Vincent Oorsprong
24-May-2010, 11:52 PM
Michael,

If you want more control over the situation use the 3rd option in the integration wizard, or the template in the create new dialog. In both cases the cVisualReport object is created as object in the reportview. That means no temporarily storage of property settings until the report is loaded and easy use of the OnInitializeReport event.

Michael Mullan
25-May-2010, 05:32 AM
OK will try that today.
MM.