VB.NET, export Crystal Reports to XML using crystal reports engine .net component

Posted on 2004-11-30
Last Modified: 2009-12-16
is there an easy way to export to xml rather than pdf in thsi scenario?  I cannot find anything on the net that has anything on it at all.  I used to be using CRAXDRT and it had the method in the same place as the PDF export.  the .net component does not...dammit.

here is the code:

    Private Sub Export(ByVal myReport, ByVal arr)
        Dim exportOpt As New ExportOptions()
        Dim diskFile As New DiskFileDestinationOptions()

        diskFile.DiskFileName = "c:\xml\" & arr & ".pdf"
        exportOpt = myReport.ExportOptions
        With exportOpt
            .DestinationOptions = diskFile
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat  '<---- change to XML somehow?  new component or different component?
        End With

    End Sub

Thanks in advance
Question by:cmgtech
    LVL 18

    Expert Comment

    Nope, no XML.

    What is the report based on? What XML output format do you want?

    Author Comment

    with the CRAXDRT, I was exporting to whatever native XML format crystal uses and then using an XSLT to transform it into something useful to myself.

    Do you think there is any other way to export to something that I can get into xml format at some point using the .NET component?
    LVL 18

    Accepted Solution

    Sure... you could export to HTML40 and pray you can hack that into something usable with XSLT...

    Otherwise, you'll have to create a dataset directly from the report's base (query/stored procedure) and dump that with XmlWriter.

    Author Comment

    I won't be able to do the second because I do not have direct access to the server.  I am only using these crystal reports because that is all i have access to.  I am doing a select * from each table, turning them into xml and merging what I need into a nested xml document... it is a pain in the ass and not very elegant but it works... sometimes.  the CRAXDRT is cousing me some grief and I have fixed it using the .NET component to do some PDF files so I might just be up a creek.  Thanks for your help though.

    Author Comment

    Ill give the HTML a shot for a bit but may have to explore new avenues.  Thanks for the help.  Full points awarded for saving me more time searching for the ellusive XML export.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    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

    8 Experts available now in Live!

    Get 1:1 Help Now