DevExpress Printing System to Printing System 4: Undeclared identifier: 'Close'

The exact code where the error occurs:
dxComponentPrinter1.PreviewWindow.Close;

Component name:
TdxComponentPrinter

The Error:
[Error] z_BuyOut.pas(3819): Undeclared identifier: 'Close'

Thoughts:
Again, I can't simply comment out the line, I need to fix it.. And apparently there's no 'Close' in the PreviewWindow property list, any solution?

Thanks.
John86aAsked:
Who is Participating?
 
OrionizerConnect With a Mentor Commented:
After researching a bit, you should be able to use the following:

dxComponentPrinter1.PreviewWindow.Release;

Be SURE when calling the Preview, to NOT call it as modal (after the release, it doesn't return focus back to your main form).  In other words, use the following to call the preview:

dxComponentPrinter1.Preview(False);

Hope this helps!
0
 
OrionizerCommented:
The dxComponentPrinter should have an event called OnAfterPreview.

Hope this helps!
0
 
John86aAuthor Commented:
What's the usage of that event? I just wanna make the preview window close.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
OrionizerCommented:
Oh, I'm sorry - I misunderstood your question.  I thought you were trying to trigger something when the preview window closed, not trying to close the preview window itself.

Is there a reason you're calling the preview in the first place (ie, do you not want a preview at all)?
0
 
John86aAuthor Commented:
Thanks!
0
 
jimyXCommented:
You can try it this way:

TCustomdxPSPreviewWindow(dxComponentPrinter1.PreviewWindow).Close;
0
All Courses

From novice to tech pro — start learning today.