I am calling a report from a form. I set the necessary filters by calling a trigger first, and then run the report. Only problem is that the request form appears first and I don’t want the user to have to go through having to click preview to view the report on screen. If I say no to the property “Use Req. Form”, then the report goes straight to the default printer. This report kind of requires a report view b/c of the different scenarioes of data displayed. I was wondering if there is a setting or programmatical statement that will suppress the request form and go to the Print Preview display right away instead of the default printer? I am basically trying to display data to the screen via print preview by just a click of a button on a form or the click of a menu option on a form. Any suggestions are greatly appreciated. Thanks in advance.
Had some kind of similar requirement, and the only solution I found was to use SendKeys… the OnRequestForm has an OnTimer trigger, and you put in some code basically calling the report to preview (Alt+v) or to print (Alt-p). Let me check to post you some sample code… Saludos Nils
Ok, here comes the code… - define a local var in the OnTimer trigger of the RequestForm wscript Automation Windows Script Host Object Model.WshShell - define local Text Constants: Text005: TextConst ‘ENU=%v;ESS=%p’; Text006: TextConst ‘ENU=%P;ESS=%I’; - Set the TimerInterval=100; - Add the following code
CREATE(wscript); CASE PrintMode OF PrintMode::Preview : wscript.SendKeys(Text005); PrintMode::Printer : wscript.SendKeys(Text006); END; CLEAR(wscript); END; Saludos Nils
Nils, I appreciate the advice. I will surely give this a shot. Thanks for your help. I’ll let you know how it goes.