Controlling export filename with Crystal Reports

Posted on 2005-05-13
Last Modified: 2008-03-03

I have some Crystal Reports in my VB6 app that pring via Crysal Reports. I have the export button enabled and I have the users saving the reports as html. Is there a way to automate the printing of the report to HTML? I'd like to be able to add a buttion where the user just presses it and it automtaically exports to HTML instead if the poor interface that appeares when you choose HTML from the file list.
Question by:bfeddish
    1 Comment
    LVL 2

    Accepted Solution


    I don't know if you are using the RDC or ActiveX version of Crytal Reports so here are two options to try

    For the RDC version

    report.ExportOptions.DestinationType = crEDTDiskFile
    report.ExportOptions.DiskFileName = "C:\Path\MyFile.htm"
    report.ExportOptions.FormatType = crEFTHTML32Standard  'or crEFTHTML40
    report.Export (false)

    For the ActiveX version

    report.Destination =crptToFile
    report.PrintFileName = "C:\Path\MyFile.htm"
    reportPrintFileType = crptHTML32Std



    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    746 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

    16 Experts available now in Live!

    Get 1:1 Help Now