コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            LowStockRep rpt = new LowStockRep();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void LoadLowStockRep()
        {
            LowStockRep aLowStockRep = new LowStockRep();

            try
            {
                //Instantiate the dataset and table adapters
                aDataSet         = new ReportDataSet();
                aLowStockAdapter = new ReportDataSetTableAdapters.LowStockTableAdapter();
                //Fill the dataset
                // aStockAdapter.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand(AuntRosieApplication.Inventory.frmInventoryStock.reportSql);


                aLowStockAdapter.Fill(aDataSet.LowStock);
                //Assign the filled dataset as the data source for the report
                aLowStockRep.SetDataSource(aDataSet);
                //Set up the report viewer object on the form
                //show the runtime report object
                crvReports.ReportSource = aLowStockRep;
            }
            catch (Exception ex)
            {
                //catch an exception thrown during data object intonation
                //or report generation and display based on the dataset
                MessageBox.Show("Data Error Encountered" + ex.ToString(), "ERROR");
            }
        }