?
Solved

Why report shows the Page Setup dialog box?

Posted on 2008-10-28
2
Medium Priority
?
304 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 400 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

764 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