in

Archived Data Techniques Forums

Crystal Reports 9.0 Problem Windows XP

Last post 07-14-2004 9:06 AM by support. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 05-11-2004 3:30 PM

    Crystal Reports 9.0 Problem Windows XP

    Having problem with added crystal reports 9.0 to Faxman 3.53. Can not send out a Fmf file?
    Crystal report made major problem in 9.0 and XP is different. I am using VB 6.
  • 05-11-2004 6:03 PM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP

    Hi David,

    We'll need some additional information to be able to help.

    Are you getting a specific error ? From what control ?
    Is the FMF file generated ?
    Which O/S are you using ?
    Sean
    Data Techniques Online Support
  • 05-13-2004 3:29 PM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP

    Crystal Reports 9 does not have the same control as 8.0. So the printing to the fax driver is different. I can get the report to output a file, but it is not putting out the .fmf fax format. I am using Windows XP Pro. No Error message. Do you have a sample of code using Crystal 9.0 printing an output to a file and not sending to a modem? I had this working under windows 98 and Crystal 8.0, but Crystal changed in Release 9.0 and removed the ActiveX control. The setting of the printer port looks like the problem

    This works in Crystal 8
    For Each Prn In Printers
    If Prn.DeviceName Like "*FaxTest*" Then
    ' Set printer as system default.
    Set Printer = Prn

    Exit For
    End If
    Next

    CrystalReports.PrinterPort = Prn.Port
    CrystalReports.PrinterName = Prn.DeviceName
    CrystalReports.PrinterDriver = Prn.driverName

    CrystalReports.ReportFileName = "c:\reports\test.rpt"
    CrystalReports.Destination = 1 '-send fax to printer
    CrystalReports.Action = 1

    -----------------------------------------------------------------------------
    Crystal 9 changes made
    Set crxReport = crxApplication.OpenReport("c:\test\test.rpt")


    For Each Prn In Printers
    If Prn.DeviceName Like "*FaxMan*" Then
    ' Set printer as system default.
    Set Printer = Prn
    'bThere = True
    Exit For
    End If
    Next

    crxReport.SelectPrinter Prn.driverName, Prn.DeviceName, Prn.Port
    crxReport.PrintOutEx False, , , , , "c:\faxout\test.fmf"

    Dave
  • 05-13-2004 6:54 PM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP

    Hi Dave,

    Sorry we dont have a Crystal 9 sample. Looking at your code however I see a problme in that you are passing the filename to the crystal PrintOutEx method. The fax filename should be set in the PrintStart event of the printer control. Crystal has no idea how to create FMF files, all it can do it send the output to the faxman print driver which does know how to create the fmf.

    I would suggest you get your code working so it can print to a regular printer then when that works change Selectprint back to using the faxman driver instance you have setup and be sure you add the code in the PrintStart event.
    Sean
    Data Techniques Online Support
  • 05-19-2004 9:05 AM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    This looks like it works with VB 6 and Crystal 9.0. If you would like a copy let me know. This covers changing the location of the database for the main and sub reports. Setting up the printer in XP was a major problem. It would be nice if you had some screen shots or a pdf file that would show how it should look.
    '----------------------------------------------------------------------------------------------------
    'VB 6 using Crystal Reports 9.0 to send a fax file out to disk
    On Error GoTo Run_Error

    Dim i As Long
    Dim Prn As Printer

    Set crxReport = crxApplication.OpenReport(App.Path & "\test.rpt")

    '---------------------fax--------------------------
    For Each Prn In Printers
    If Prn.DeviceName Like "*FaxMan*" Then
    Set Printer = Prn
    Exit For
    End If
    Next

    FaxMan.AppID = "FaxTest"
    crxReport.SelectPrinter Prn.DriverName, Prn.DeviceName, Prn.Port
    crxReport.DisplayProgressDialog = True
    crxReport.EnableParameterPrompting = True
    crxReport.UseIndexForSpeed = True

    ' Use the DiscardSavedData method to ensure that your report hits the Database and refreshes the data
    crxReport.DiscardSavedData
    For i = 1 To crxReport.Database.Tables.Count
    crxReport.Database.Tables(i).Location = App.Path & "\test.mdb"
    Next i

    If crxReport.RecordSelectionFormula > "" Then
    crxReport.RecordSelectionFormula = crxReport.RecordSelectionFormula & " and " & gFormula
    Else
    crxReport.RecordSelectionFormula = gFormula
    End If

    '-------------------------------------------------------
    ' Check For Subreports
    Dim x As Long

    Set crxSections = crxReport.Sections

    For Each crxSection In crxSections

    For x = 1 To crxSection.ReportObjects.Count
    If crxSection.ReportObjects(x).Kind = crSubreportObject Then
    Set crxSubreportObject = crxSection.ReportObjects(x)
    Set CrxSubreport = crxSubreportObject.OpenSubreport
    Set crxDatabase = CrxSubreport.Database
    Set crxDatabaseTables = crxDatabase.Tables
    For Each crxDatabaseTable In crxDatabaseTables
    crxDatabaseTable.Location = App.Path & "\test.mdb"
    Next crxDatabaseTable
    End If
    Next x

    Next crxSection


    crxReport.PrintOut False


    Exit Sub
    Run_Error:
    ' MsgBox "Error# " & Err.Number & " " & Err.Description & " Report=" & gCrystal_Report & vbCrLf & gFormula, vbCritical
    MsgBox Err.Description
    MousePointer = vbNormal
    Resume Next
    Exit Sub

    End Sub



    Private Sub FaxMan_PrintStart(PrintFileName As String)

    PrintFileName = App.Path & "\test.fmf"
    End Sub
  • 05-19-2004 11:32 AM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    Hi David,

    Just to confirm you got your printing working corectly from Crystal 9 right ?

    Did you use the Faxinstall utility to install the printer driver in XP ? What did you have a problem with exactly ?
    Sean
    Data Techniques Online Support
  • 05-27-2004 2:54 PM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    You might want to be aware of this problem, which might be related.

    We are getting a memory 2kB leak in the Crystal Report 9 Pro's Report.PrintOut method each time that method is called. There seems to be no workaround.

    This does not sound like much of a leak, but when running our application on a Citrix server, the application crashes (just disappears) after printing 6 reports. Citrix probably provides less available memory to each application running.

    We tried printing to a PDF file (using the "Acrobat Distiller" printer driver) and still get this, so we assume the memory leak is in the Crystal Reports PrintOut method and not in the HP printer drivers.

    I tried downloading and installing the latest Crystal Reports service pack (SP1) and the latest monthly hotfixes (03/03/2004) but the problem still exists.

    I saw a problem posted on another website where it appears that a similar problem (or the same one) occurs when PrintOutEx is called.

    I am contacting Business Objects, which now owns Crystal Reports (www.BusinessObjects.com).
  • 07-12-2004 1:42 PM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    I did get the system to print one fax file, but when I try to print more than on I get " Unable to get Filename for Post: FaxTest".

    Do you have any examples that use Crystal 9.0 for creating a fax file? This program runs a series of one page fax files.

    When I send more than one fax the whole process does not work.

    Also the ActiveX Print Contol cause the VB 6 program to crash, with the last Update 3.53 Ver.

    Dave
  • 07-13-2004 9:16 AM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    Hi David,

    Sorry we dont have a specific Crystal 9 sample. Could you send us the code you are using to print ? That way we can see whats happening. If you are getting the Unable to Get Filename then it means that either the Printer Control isnt loaded or you are setting the PrintFileName parameter in the PrintStart event.
    Sean
    Data Techniques Online Support
  • 07-13-2004 11:18 AM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    When I put the printer control on the form, VB 6 crashes. Where Do I send the source code to?

    Dave
  • 07-14-2004 9:06 AM In reply to

    Re: Crystal Reports 9.0 Problem Windows XP VB 6

    Hi Dave,

    Send the code to us at support@data-tech.com
    Sean
    Data Techniques Online Support
Page 1 of 1 (11 items)
Copyright 2009 Data Techniques, Inc. All Rights Reserved.