Solved

Why report shows the Page Setup dialog box?

Posted on 2008-10-28
2
258 Views
Last Modified: 2013-11-05
I have written several reports in CR XI R1.  These reports are run and displayed using a Visual Basic 6 application.  When the users view the reports and click on a field, some or all of the fields on the viewed report are highlighted with a blue background and the "Page Setup" dialog box is displayed.

When the users click the Cancel button on the Page Setup box, the printer dialog box is displayed but the fields on the report are still highlighted in blue.

The printing process seems to work fine but the highlighted fields are a distraction to the users and there is no reason for the Page Setup dialog box to be shown.

What is happening.  This occurs on all of the users computers and on my development computer.

Thanks for any help or direction.

Below is my VB6 code for showing the CR report:


Option Explicit

Dim Report As dsrMaster_Next_TD_No_By_Company

Private Sub CrystalActiveXReportViewer1_Clicked(ByVal X As Long, ByVal Y As Long, EventInfo As Variant, UseDefault As Boolean)
    UseDefault = False
    Report.PrinterSetup (hWnd)
    Report.PaperOrientation = crPortrait
    On Error GoTo Cancel:
    Report.PrintOut True

Cancel:
    Exit Sub
End Sub

Private Sub Form_Activate()
    Set Report = New dsrMaster_Next_TD_No_By_Company

    Report.EnableParameterPrompting = False
    Screen.MousePointer = vbHourglass
    CrystalActiveXReportViewer1.ReportSource = Report
    CrystalActiveXReportViewer1.DisplayTabs = False
    CrystalActiveXReportViewer1.DisplayToolbar = True
    CrystalActiveXReportViewer1.EnableGroupTree = False
    CrystalActiveXReportViewer1.EnableExportButton = True
    CrystalActiveXReportViewer1.ViewReport
    CrystalActiveXReportViewer1.Zoom (100)

    Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Resize()
    CrystalActiveXReportViewer1.Top = 0
    CrystalActiveXReportViewer1.Left = 0
    CrystalActiveXReportViewer1.Height = ScaleHeight
    CrystalActiveXReportViewer1.Width = ScaleWidth
End Sub

0
Comment
Question by:EYoung
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 100 total points
ID: 22838049
Why are you using the Viewer click event to allow th euser to print.  The viewer has a PRINT icon.

Try changing the
    Report.PrintOut True
to
    Report.PrintOut False

mlmcc
0
 
LVL 7

Author Comment

by:EYoung
ID: 22843389
I am not using the Viewer click event to allow the user to print.  The user does click on the print icon when they want to print.

The problem comes when the user accidently clicks anywhere on the body of the report and the Page Setup window pops up and some of the fields get highlighted.

I did try changing the Report.PrintOut from True to False and that did not change anything except it caused to report to automatically print when I click on any field on the report and then click Cancel when the Page Setup window pops up.

Then I completely removed the CrystalActiveXReportViewer1_Clicked event from the VB code and that fixed the problem.  So... your suggestion lead me in the right direction.

Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now