Output Results to a Crystal Report

Posted on 2005-04-18
Last Modified: 2013-12-24
Hi All,

I am quite new to Coldfusion so please bear with me.

I have written a codfusion app that tracks our quotes going out to customers.  It is an Access MDB on a Windows 2000 box with Coldfusion (v5).  I have written the site in Dreamweaver.  I have Crystal Enterprise 10 installed on the box.

I want to achieve this - allow the users to view a Crystal Report through their web browser (as they will not have Crystal installed) to show, for example all Lost quotes for a region.  I.e. the link will show "Lost Quotes Report" which they will click on and the report will be displayed in the web browser.

I know my datasource etc, and it is not password protcted.  Can anyone give me a basic overview (step by step_ of how I can do this?

One other piece of info - I only have Crystal 9 for writing the reports, however I have ordered Crystal 11 which shoudl be here tomorrow.


Question by:sr_millar
    LVL 9

    Expert Comment

    Hi sr_millar,

     Its actually very complicated... But here goes the basics.

     you need to createobject to a couple of com objects.

    CrystalReports10.ObjectFactory.1 - Is the factory
    CrystalReports.ReportAppSession - Is the ReportAppSession
    and CrystalReports.ReportClientDocument - Is the client document.

    open a connection to the com object for factory. the use something like this to get ReportAppSession

    <cfset Factory = CreateObject("com","CrystalReports10.ObjectFactory.1")>
    <cfset ReportApp = Factory.CreateObject("CrystalReports.ReportAppSession")>
    <cfset ClientDoc = ReportApp.CreateService("CrystalReports.ReportClientDocument")>
    <cfset pc = variables.o_Factory.CreateObject("CrystalReports10.CrystalPrintControl.1") />
    <cfset getClientDoc().DatabaseController().Logon(this.Username, this.Password) />
    <cfset o_PrintOutputController = getClientDoc().PrintOutputController() />
    <cfset SetupParameters(Arguments.Parameters) /> <!--- Will explain this as its complicated --->
    <cfset pc.DownloadHandler(variables.o_ClientDoc.ReportSource) />
    <cfset pc.PrinterName(Arguments.Printer) />
    <cfset pc.PrintReport() />

    basically with the parameters ( I haven't done CF5.0 for a long time and this example is cf mx6.1 +)

                    for (i=1; i lte ListLen(Arguments.parameters); i=i+1)
                        result = ListgetAt(Arguments.parameters,i);
                        ParamCollection = getClientDoc().DataDefinition().ParameterFields;
                        ParamToChange = ParamCollection.Item(i-1);
                        NewValue = GetFactory().CreateObject("CrystalReports.ParameterFieldDiscreteValue");
                        NewValue.Value = result;
                        TempParam = GetFactory().CreateObject("CrystalReports.ParameterField");
                        ParamToChange.CopyTo (TempParam);
                        ParamController = getClientDoc().DataDefController().ParameterFieldController();
                        ParamController.Modify (ParamToChange, TempParam);

    Sorry that I am not much more use, but if you goto they have a developer zone which might be able to help you more converting the above to Coldfusion 5.0

    LVL 9

    Expert Comment


    Don't worry about crystal 9 for writing the reports, Crystal 10 will still open crystal 9 written reports.
    LVL 9

    Expert Comment


    Oh forgot to say that you can export the report to a pdf then use cfcontent to display the pdf normally. If you like I can try to convert the code to cf 5.0 from mx6.1 at a cost if you like, but you will need to give me a few days to get it converetd and setup an example site for you to see it in action.

    I'll leave it up to you.
    LVL 7

    Author Comment


    I have managed to get my system to work using a product called ReCrystallize (  It seems to be doing everything I need it to.  Thank you for trying to help me though.


    Accepted Solution

    The question has been PAQ'd and the 500 points have been refunded.
    Community Support Moderator

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and Log…
    The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Open Page or Post…

    732 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