Results 1 to 4 of 4

Thread: Crystal report to XML

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Crystal report to XML

    Help me
    How can I do (by coding) to export the layout of the report (Version 10 or 11) to XML ? Thank first

  2. #2
    Addicted Member craigreilly's Avatar
    Join Date
    Jul 2004
    Location
    Scottsdale, AZ
    Posts
    188

    Re: Crystal report to XML

    VB Code:
    1. report.ExportOptions.FormatType=CRExportFormatType.crEFTXML

    This will get the results of the report and export to XML.

    Are you actually looking to export the format of the report?


  3. #3

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Re: Crystal report to XML

    could you show me full code and tell me which version ? thank you very much !

  4. #4
    Addicted Member craigreilly's Avatar
    Join Date
    Jul 2004
    Location
    Scottsdale, AZ
    Posts
    188

    Re: Crystal report to XML

    Here is my code for VB.NET 2003 to Crystal 9.
    But my code for VB.NET 2005 to Crystal 10 is exactly the same.
    I have never exported to XML before - but play with the three '*' lines.

    And be sure to add the proper crystal references in your solution explorer. My current project has CRAXDRT (Crystal Reports Active X component).

    VB Code:
    1. Dim application As New CRAXDRT.Application
    2. Dim report As CRAXDRT.Report
    3. report = application.OpenReport("s:\programs\reports\events.rpt", 1)
    4. report.RecordSelectionFormula = "{command.locationid} = " & locid 'If you need to pass any parameters. Can also use "report.GroupSelectionFormula"
    5. report.ExportOptions.FormatType = CRAXDRT.CRExportFormatType.crEFTPortableDocFormat '*
    6. report.ExportOptions.DestinationType = CRAXDRT.CRExportDestinationType.crEDTApplication '*
    7. report.ExportOptions.ApplicationFileName = "S:\programs\reports\pdf\events.pdf" '*
    8.  
    9. report.Export(False)
    10. report = Nothing
    11. application = Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width