Skip to content

Generating reports onPDF format for the source being XML file

Pallavi

Asked Apr 12, 2008, 1:39 AM EDT1 answer
Share
LinkedInX
We were trying to generate PDF documents for the purpose of report generation and we' want to use XML files as its source...please help

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    In your  solution explorer right click on your project>Add new Item>CrystalReport, if you are licensed to use Crystal report within VS then  a widsard
    1. A from Called Crystal report gallery will appear click OK button
    2. A from Called Standard Report wizard Appears expand the New connection  tree view node at left then click the data base files node a open dailog box appearts
    3. Browse to your XML file in your hard disk or in your local network after selecting the XML file as file type
    4. The file nodes appear in the treeview select your data that you want to export to pdf from the xml file hieherachy add click the > labelled button  the targeted nodes  will  apeart at the right in the list click next
    5. Same think for the next wizard page select the field to be displayed and click the > labelled button then next>next>Finish
    6. Now you have a crystal report linked to the xml file
      Now browse to your code editor and then impelement this method that export the xml file to a pdf doc as follow
    In windows context

    CrystalReport1 myReport = new CrystalReport1();
                myReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"C:\Generated.pdf");
                MessageBox.Show("Job is done!!!");
    In a web context
    use ExportToHttpResponse instead of Export to disk
    0