Solved

Why report shows the Page Setup dialog box?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports  Formula to Command 4 86
Pictures In Crystal 10 55
Crystal Report Date Range Parameters 2 73
Crystal Reports Version 7 4 33
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

790 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