skearton Posted February 21, 2015 Posted February 21, 2015 I need help figuring out why my preview mode is showing nothing in the script below. Funny thing is when I use the script debugger tool and walk through each step, the preview mode works... The layout has a header, sub-summary, body, trailing grand summary & footer parts. New Window [ Name: "New Monthly Orders Total"; Style: Document; Close: “Yes”; Minimize: “Yes”; Maximize: “Yes”; Zoom Control Area: “Yes”; Resize: “Yes” ] # Go to Layout [ “Print Change to Live Order Report” (INVOICElogic_invoiceID_customerID) ] # Print Setup [ Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore; No dialog ] # Adjust Window [ Resize to Fit ] # Enter Preview Mode # Show Custom Dialog [ Title: "Print"; Message: "Click Continue to print."; Default Button: “Continue”, Commit: “Yes” ] # Print [ Records being browsed; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore ] # Close Window [ Current Window ]
Rick Whitelaw Posted February 21, 2015 Posted February 21, 2015 Why enter Preview mode at all? It's not necessary.
skearton Posted February 21, 2015 Author Posted February 21, 2015 The users like to see the preview of the report before they print.
LaRetta Posted February 21, 2015 Posted February 21, 2015 I do not see a sort included. The report must be sorted by the field defined in the sub-summary part.
bruceR Posted February 22, 2015 Posted February 22, 2015 I would also suggest this order of script steps: New Window Go to layout Print Setup Sort Enter Preview Mode Adjust Window Resize to fit Go to record/page Last Go to record/page First Show Dialog
Rick Whitelaw Posted February 22, 2015 Posted February 22, 2015 The users like to see the preview of the report before they print. Perhaps I'm missing something here, but if all the necessary steps have been done, including the Sort to show the sub-summary properly, then the main difference between Browse Mode and Preview Mode is that Preview Mode will not show objects that have been selected to be hidden when printing. That's the only reason I use Preview Mode and I have many Layouts that are meant to be printed. I have yet to go to preview mode in a script. Corrections welcome!
LaRetta Posted February 22, 2015 Posted February 22, 2015 Besides object visibility (Hide while printing), what if you want to remove blank space (checking objects to slide up)? Preview Mode is the only method of seeing what a layout REALLY looks like as it appears on the printed page, page breaks etc. :-)
skearton Posted February 22, 2015 Author Posted February 22, 2015 I have done as all that has been suggested but it still doesn't shown anything. Why, when I go to that layout directly, I can enter preview mode and see it but within the script, I see nothing. Seems contradictory. I have never encountered this issue before.
LaRetta Posted February 22, 2015 Posted February 22, 2015 It is something simple. Have you used debugger and walked through the script and made sure that it is going to the correct layout and that it is finding records? When you 'manually' do it, do you sort it? I still suspect that the sort is not the same as the sub-summary part's break field. Can you print your script to PDF (or preview) and copy/paste it here? Or zip and attach your file? We'll help you figure it out. :-)
comment Posted February 22, 2015 Posted February 22, 2015 I have done as all that has been suggested but it still doesn't shown anything. Why, when I go to that layout directly, I can enter preview mode and see it but within the script, I see nothing. Seems contradictory. I have never encountered this issue before. I cannot reproduce the problem, but the thing that jumps out at me is that you do: Enter Preview Mode # Show Custom Dialog [ ... ] where one would expect: Enter Preview Mode [Pause] Show Custom Dialog [ ... ] Is it possible that you just don't give enough time for the layout to render?
LaRetta Posted February 23, 2015 Posted February 23, 2015 (edited) That is an intriguing consideration, Michael! And that might explain why, the hesitation in steps in the Custom Dialog, would give it time to refresh. It seemed, to me, that when manually running it, the sort order is already established (how it needs to be for the sub-summary) but when scripted, no 'identical' sort is used or it is from wrong context(?). I sure hope we get the chance to find out what is causing it! :-) Pardon my error ... I have data viewer on the brain. I corrected my entry in bold. Edited February 23, 2015 by LaRetta
Recommended Posts
This topic is 3561 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now