Solved

Printing issue with saved CR7 file

Posted on 2002-04-01
22
310 Views
Last Modified: 2008-02-01
I am using the Crystal 7 runtime file in a home ground application.  When I print a saved Crystal Report some pages pint bad data.  This happens in the page header b section.  My page header b represents that table columns in the database.  The names are not hard coded, but change with the database that is being used.

This is what happens: If I run a report from scratch it looks and prints correctly.  If I save that report it will open and all data looks correct, but when I print it several of the pages print bad information.

What I mean by bad information is this:
     The column names will print on top of each other, or instead of printing the word 'Date' it might print 'D  e' [leaving out the 'a' and 't'].   Or it might print the whole word Date so that all the letters are printed on top of each other.    


It is odd because it will not do this with every page of the report.  It might just do it on page one and page 5 of a 10 page report, and all the other pages print correctly.  

This only happens if we open a crystal report in our application.  If we open it up in the crystal report designer it will print correctly.  


Do you have any thoughts as to why this might be?
0
Comment
Question by:DandL
  • 14
  • 3
  • 2
  • +2
22 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 6910361
I would suspect a printer driver problem.  You might try reloading the print driver for your printer.

good luck
mlmcc
0
 
LVL 1

Author Comment

by:DandL
ID: 6910387
We have been able to rule out the printer.  There are over 1000 printers and every printer we have tried produces the same results.
Any other ideas?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6911909
Does the report use a fancy font that might not be loaded on your printer.  I have seen problems with some fonts that act somewhat like that at times.  Usually though it happens on all records or headers not just some.

Are some of the headers suppressed conditionally?

What code are you using to print the report from the application?

mlmcc
0
 
LVL 1

Expert Comment

by:kzbera
ID: 6915040
Just a wild thought, but sometimes gives desired result.

what I guess from your problem description you are using
crystal report standard format. and as your page header b gets the information from database (which is changing also)
instead of placing the database fields in page header b use formula which will just be the names of the database fields and place them accordingly.Keep enough space for the formulae field.
Also use normal font like arial, times new roman etc and check for printer driver.

Best of luck
0
 
LVL 1

Author Comment

by:DandL
ID: 6915329
0
 
LVL 1

Author Comment

by:DandL
ID: 6915336
mlmcc
>Does the report use a fancy font that might not be loaded on your printer.
No. Some pages print correctly and some do not.
0
 
LVL 1

Author Comment

by:DandL
ID: 6915337
kzdera
I miss wrote in my first post. I said:
 "The names are not hard coded, but change with the database that is being used. "

I was wrong the column names are hard coded.
0
 
LVL 1

Author Comment

by:DandL
ID: 6915339
This is(a very small part of) the code we are using in our application.  It is probably more detail then you wanted but here it is.



'this is what we are using to print the report
Private Sub mnuFilePrint_Click()
  On Error GoTo ProcError
 
  If (TypeOf mdiMain.ActiveForm Is frmReport) Or _
     (TypeOf mdiMain.ActiveForm Is frmReportViewer) Then
    'just using printreport  
    mdiMain.ActiveForm.PrintReport
  End If
 
  Call UpdateStatusBar("")
 
ProcExit:
  Exit Sub

ProcError:
  Teradata.DisplayError False, App, "mnuFilePrint_Click", "Unknown report type: Cannot print this type of report"
End Sub
0
 
LVL 1

Author Comment

by:DandL
ID: 6915342
'this is print
Public Sub PrintReport()
  On Error GoTo ProcError
 
  Select Case menumReportType
    Case daRVTAnalyzer
      Me.Analyzer.PrintGrid

    Case daRVTCrystalReport, _
         daRVTCrystalChart
      Call vwrCrystalViewer_PrintButtonClicked(False)
  End Select
 
  Exit Sub

ProcError:
  mdiMain.Teradata.DisplayError False, App, "PrintReport", "An error occurred while printing the report."
End Sub
0
 
LVL 1

Author Comment

by:DandL
ID: 6915343
0
 
LVL 1

Author Comment

by:DandL
ID: 6915344
Private Sub vwrCrystalViewer_PrintButtonClicked(UseDefault As Boolean)
  Dim CRApp As CRAXDRT.Application
  Dim rp As CRAXDRT.Report
 
  UseDefault = False
       
  Set CRApp = New CRAXDRT.Application
  Set rp = CRApp.OpenReport(mstrFileName, crOpenReportByTempCopy)
 
  mdiMain.PrintCrystalReport Me.hwnd, _
                             mobjReportObject, _
                             Me.vwrCrystalViewer.GetCurrentPageNumber, _
                             Me.vwrCrystalViewer.GetCurrentPageNumber, _
                             False
 
  Set rp = Nothing
  Set CRApp = Nothing
End Sub
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:DandL
ID: 6915346
'Set up printer and print

Public Sub PrintCrystalReport(hWndOwner As Long, _
                              rptReport As CRAXDRT.Report, _
                              Optional ByVal FromPage As Integer = 1, _
                              Optional ByVal ToPage As Integer = 1, _
                              Optional ByVal DiscardSavedData As Boolean = True)
 
  Dim intButtonPressed       As Integer
  Dim intDefaultPrinterIndex As Integer
 
  'Static sblnBusy            As Boolean
 
  On Error GoTo ErrorHandler
 
  If Not mblnPrintingCrystalReport Then
    mblnPrintingCrystalReport = True
    SetMousePointer vbHourglass
    Call MaintainMenus
   
    ' Save the index of the current default printer
    Printer.TrackDefault = True
    For intDefaultPrinterIndex = 0 To Printers.Count - 1
      If Printer.DeviceName = Printers(intDefaultPrinterIndex).DeviceName Then
        Exit For
      End If
    Next intDefaultPrinterIndex
 
    ' Set default printer settings of the GLOBAL Printer object based on
    ' the custom settings for the report view in rptReport
    With Printer
      .Orientation = rptReport.PaperOrientation
      .PaperSize = rptReport.PaperSize
      .Copies = 1
      .Duplex = vbPRDPSimplex
      .ColorMode = vbPRCMMonochrome
    End With
   
    SetMousePointer vbDefault
   
    intButtonPressed = ChoosePrinter(hWndOwner, _
                                     cdlPDPageNums Or cdlPDNoSelection, _
                                     FromPage, _
                                     ToPage, _
                                     , _
                                     1)
   
    If intButtonPressed <> DLG_CANCEL Then
      If intButtonPressed = DLG_ERROR Then
        MsgBox "Unable to show the printer dialog box. The default printer will be used.", vbExclamation, "Print"
      End If
     
      'SetMousePointer vbHourglass
      SetMousePointer vbArrowHourglass
      UpdateStatusBar ("Printing current report view...")
         
      ' Set rptReport's printer settings (where applicable) equal to the settings in the
      ' global Printer object, which might have been changed by the user via the common
      ' Print dialog
      With rptReport
        If DiscardSavedData Then
          .DiscardSavedData
        End If
        .SelectPrinter Printer.DriverName, Printer.DeviceName, Printer.Port
        .PaperOrientation = Printer.Orientation
        .PaperSize = Printer.PaperSize
        If (FromPage Or ToPage) = 0 Then
          .PrintOut IIf(intButtonPressed = DLG_ERROR, True, False), IIf(Printer.Copies = 0, 1, Printer.Copies)
        Else
          .PrintOut IIf(intButtonPressed = DLG_ERROR, True, False), IIf(Printer.Copies = 0, 1, Printer.Copies), , FromPage, ToPage
        End If
      End With
 
      ' Reset Printer object back to what it was originally
      Set Printer = Printers(intDefaultPrinterIndex)
    End If
    mblnPrintingCrystalReport = False
  Else
    Beep
    MsgBox "VISTA is busy printing the current report view.  Please try again later.", vbOKOnly + vbExclamation, "VISTA Reporting System - Print"
  End If
 
ProcExit:
  SetMousePointer vbDefault
  Call MaintainMenus
  UpdateStatusBar ("")
 
  Exit Sub

ErrorHandler:
  If Not Teradata Is Nothing Then
    Teradata.DisplayError False, App, "PrintCrystalReport", "VISTA was unable to print this report.  " & _
                                      "You may try selecting a different paper size, orientation, " & _
                                      "or another printer before trying to print again."
  Else
    MsgBox "VISTA was unable to print this report." & vbCrLf & vbCrLf & "The following error occurred:" & _
           vbCrLf & vbCrLf & Err.Number & "  " & Err.Description, vbExclamation, "Print"
  End If
 
  mblnPrintingCrystalReport = False
  Resume ProcExit
End Sub
0
 
LVL 1

Author Comment

by:DandL
ID: 6915348
Sorry for so many posts but I keep geting an error when I tried to post everything at once.

DandL
0
 
LVL 1

Author Comment

by:DandL
ID: 6915488
Ok, I think I might have figuard out what is going on.  If my text object has a return char in it or if the text object contains text that requires more than one line, it produces the bad text on the first page.  Have y'all run into that before?
0
 
LVL 4

Expert Comment

by:wileecoy
ID: 6915519
Try setting the 'can grow' property on the fields in question so that any additional information will expand the field.

I had a similar, but not exact problem, and I believe this solved it for me.

hth.

Wileecoy.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6915563
Sorry you have had problems; our Engineering team is working diligently to correct the problem and intermittent outages you've experienced.  Working on the solution as I type this for Milestone Release 3.0.1, noted in "What's New".
Your patience and understanding is appreciated.
:)
Moondancer - EE Moderator
0
 
LVL 1

Author Comment

by:DandL
ID: 6916169
wileecoy,
I tried the can grow but that did not seem to work.
Any other ideas?
0
 
LVL 1

Author Comment

by:DandL
ID: 6916171
>I tried the can grow but that did not seem to work.
Well it worked but did not solve me issue.
0
 
LVL 4

Expert Comment

by:wileecoy
ID: 6943490
The only other thing that I can think of is to e-mail it to me and see if I can use it.

If you want to - WileecoyForEE@AOL.com

hth.

Wileecoy.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6943755
If the field taht is too large or must grow has fields under it the other fields won't move down the page.  A field that grows must (in my experience) be the last field in a section.
If you have data after the field in question, add a new detail field below the current one and copy/move the fields down.  In that way the detail section will grow as required then the next detail section will start.

good luck
mlmcc
0
 
LVL 1

Author Comment

by:DandL
ID: 6944642
Well this is what we found out....though we did not figure out why it was happening.  

We found that every page of the cr that we view before printing becomes corrupted.  All we did to fix the problem is when the user hits 'print' we just open the CR again and then print it.  And all works well.

Thanks for your help.
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 6958600
100 points refunded, this question moved to our PAQ to close at zero points.

Thanks, DandL for adding the solution that worked for you.

Moondancer - EE Moderator
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

17 Experts available now in Live!

Get 1:1 Help Now