|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace XMLCRReport
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
DataSet dsReport = new dsCDCatalog();
// create temp dataset to read xml information
DataSet dsTempReport = new DataSet();
try
{
// using ReadXml method of DataSet read XML data from books.xml file
dsTempReport.ReadXml(@"C:\articles\XmlCrystalReport\cd_catalog.xml");
// copy XML data from temp dataset to our typed data set
dsReport.Tables[0].Merge(dsTempReport.Tables[0]);
//prepare report for preview
rptXMLData rptXMLReport = new rptXMLData();
rptXMLReport.SetDataSource(dsReport.Tables[0]);
crystalReportViewer1.DisplayGroupTree = false;
crystalReportViewer1.ReportSource = rptXMLReport;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Asif Sayed has over twenty + years experience in software development and business process architecture. He has a consulting firm in Toronto, Canada. His firm provides IT solutions to all sizes of industries. He also teaches .NET technologies at Centennial College in Scarborough, Ontario. Recently he has become member of team as a subject matter experts with Microsoft's Learning Division. He has a book published by Apress with the Title "Client-Side Reporting with Visual Studio in C#".
My blog: http://www.dotnetsme.com
My Website: http://www.feathersoft.ca