PDA

View Full Version : Passing parameters to report VRW



ramide
21-Sep-2010, 12:56 PM
Hello

I'm starting to use the "Visual Report Writer" and have a question that I believe is a very simple solution, but could not find.

I created a report using the wizard VRW. The piece of code that interacts with the report is as follows:




Procedure StartReport
Integer eOutputDevice
String sReportName
Boolean bOk
String sReportId
String sFilterFunction
String sFromSizesCode sToSizesCode

Get Value of oFromSizesCode To sFromSizesCode
Get Value of oToSizesCode To sToSizesCode

Move (Trim (sToSizesCode)) To sToSizesCode
Move (Trim (sFromSizesCode)) To sFromSizesCode

If (sFromSizesCode <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{SIZES.Code} >= CStr (" + '"' + sFromSizesCode + '"' + ")") To sFilterFunction
End
If (sToSizesCode <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{SIZES.Code} <= CStr (" + '"' + sToSizesCode + '"' + ")") To sFilterFunction
End

Move "TestVRW1.vrw" to sReportName

Get Output_Device_Mode to eOutputDevice
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

Send StartReport of oVRWPreviewPanel
End
End_Procedure




In the report "TestVRW1.vrw" I created a function called "MyTest" and would send a text to this function to be displayed in the report. Like I said before, this is a very simple question, but I am not able to do... :(

The question is:
What must I include in that code up there to pass a value to a function of VRW??
If you want to send me a complete example, feel free! :o

Best regards

Vincent Oorsprong
21-Sep-2010, 03:30 PM
Edimar,

With the version you have the easiest way is to choose for "embedded in reportview" in the integration wizard. With the upcoming update we reviewed this and made it more simple with for the other report integrations as well.

So, for the moment use the embedded in reportview, where you have a cVisualReport object in the report view or wait a couple of more days (no final date set but it will be soon).