예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CRHelperClass db = new CRHelperClass();

                CRProductReport cr = new CRProductReport();
                cr.SetDataSource(db.GetData());
                CrystalReportViewer1.ReportSource = cr;
            }
        }
예제 #2
0
        public ActionResult ViewReport()
        {
            CRHelperClass cRHelper = new CRHelperClass();

            CRProductReport cRProduct = new CRProductReport();

            cRProduct.SetDataSource(cRHelper.GetData());

            System.IO.Stream model = cRProduct.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return(File(model, "application/pdf"));
        }