Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            OfficeIOUExp rpt = new OfficeIOUExp();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        //IOU
        private void DataSet2(string qry)
        {
            DataTable       table = new DataTable();
            MySqlDataReader reader;

            table.Columns.Add("date", typeof(DateTime));
            table.Columns.Add("first_name", typeof(string));
            table.Columns.Add("Category", typeof(string));
            table.Columns.Add("amount", typeof(double));


            try
            {
                reader = DBConnection.getData(qry);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        table.Rows.Add(reader.GetDateTime("date"), reader.GetString("first_name"), reader.GetString("Category"), reader.GetDouble("amount"));
                    }
                }
                reader.Close();

                OfficeExpensesForm.Reports.OfficeIOUExp report = new Reports.OfficeIOUExp();

                report.Database.Tables["OffDirect"].SetDataSource(table);


                crystalReportViewer1.ReportSource = null;
                crystalReportViewer1.ReportSource = report;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
        }