Passing a variable to a report + printerselection

Hi! I wan’t to pass a variable to a report like this: REPORT.Function(Variable); And then run the report with no requestform and using the printer set up in the printer selection table. If I do not want to pass the variabel, I can use Report.Run(report,False,False,Rec) but that’s not enough here - or is it?

That is correct. You need to define a variable of type Report, and specify your report’s ID as the variable’s subtype to be able to call functions in the object.

Hello Jan Yes, but how do I combine it like in this pseudo-code example: Report.PassAVariableFunction(Variabel); //Report XXXX declared as ‘Report’. Report.Run(XXXX,False,False,Rec);

If XXX is your Report variable, then you can do it like this: XXX.SetVariable(Var); XXX.SETTABLEVIEW(Rec); XXX.USEREQUESTFORM(FALSE); XXX.RUN;

Hi JHOEK But in this way wont be able to use a printer from the printer selection table - and that is exactly what i want to do!

Soory Nelson! Your solution worked fine! When you use XXX.SetVariable(Var); XXX.SETTABLEVIEW(Rec); XXX.USEREQUESTFORM(FALSE); XXX.RUN; the report will be printed on the printer in the printer selection table! If XXX doesn’t have an entry in the table, I guess it will print on the users standardprinter!