Пример #1
0
        private void ReportsForm_Load(object sender, EventArgs e)
        {
            PageReport report = LayoutBuilder.BuildReportLayout();                //Loading the layout to a PageReport object

            report = LayoutBuilder.AddDataSetDataSource(report);                  //Adding DataSources to the PageReport object
            MemoryStream reportStream = LayoutBuilder.LoadReportToStream(report); //Loading the PageReport object to a stream

            reportStream.Position = 0;

            //Loading the stream to the designer via a  XmlReader
            reportDesigner.LoadReport(XmlReader.Create(reportStream), DesignerReportType.Page);//Loading the stream to the designer
            report.Dispose();
            reportStream.Dispose();
        }
Пример #2
0
        private void ReportsForm_Load(object sender, EventArgs e)
        {
            // Load a layout into a page report object.
            PageReport report = LayoutBuilder.BuildReportLayout();

            // Add a data source to a page report object.
            report = LayoutBuilder.AddDataSetDataSource(report);
            // Load a page report object into a stream.
            MemoryStream reportStream = LayoutBuilder.LoadReportToStream(report);

            reportStream.Position = 0;
            // Load the stream to the Viewer.
            viewer1.LoadDocument(reportStream, GrapeCity.Viewer.Common.DocumentFormat.Rdlx);

            report.Dispose();
            reportStream.Dispose();
        }