Solved

Why report shows the Page Setup dialog box?

Posted on 2008-10-28
2
301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 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