예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SummaryFormReport rpt = new SummaryFormReport();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void previewReport(string qry)
        {
            DataTable table = new DataTable();

            MySqlDataReader reader = null;

            table.Columns.Add("Article", typeof(string));
            table.Columns.Add("Color", typeof(string));
            table.Columns.Add("Size", typeof(string));
            table.Columns.Add("Qty", typeof(int));

            try
            {
                reader = DBConnection.getData(qry);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        table.Rows.Add(reader.GetString("Article"), reader.GetString("Color"), reader.GetString("Size"), reader.GetInt32("Qty"));
                    }

                    reader.Close();

                    Report.SummaryFormReport rpt = new Report.SummaryFormReport();

                    rpt.Database.Tables["Items"].SetDataSource(table);

                    summaryReportViewer.ReportSource = null;
                    summaryReportViewer.ReportSource = rpt;
                }
                else
                {
                    reader.Close();

                    MessageBox.Show("No records!", "Items picker", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("" + ex, "Items picker", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }