Solved

Why report shows the Page Setup dialog box?

Posted on 2008-10-28
2
272 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Report Error 14 73
Crystal Report Filter Question 6 58
Crystal reports subreports as total of main report 13 52
Crystal Reports Date Calculation 10 37
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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

867 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

18 Experts available now in Live!

Get 1:1 Help Now