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

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void GetCurrentAssetList()
        {
            try
            {
                AssetInformationBAL     objAssetInformationBal  = new AssetInformationBAL();
                DataTable               dtCurrentAssetList      = new DataTable();
                frmReportViewer         objfrmReportViewer      = new frmReportViewer();
                cr_CurrentAssetList     objcrCurrentAssetList   = new cr_CurrentAssetList();
                RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL();
                dtCurrentAssetList = objAssetInformationBal.GetCurrentAssetInfo();

                int TempBranchId = -2;
                int branchid     = Int32.Parse(dtCurrentAssetList.Rows[0][8].ToString());

                int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Current_Asset_List);
                int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId);

                TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId));

                if (TempBranchId == -1)
                {
                    dtCurrentAssetList.Rows.Clear();
                }
                objcrCurrentAssetList.SetDataSource(dtCurrentAssetList);

                GetCommonInfo();
                ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;


                objfrmReportViewer.crvReportViewer.ReportSource     = objcrCurrentAssetList;
                objfrmReportViewer.crvReportViewer.DisplayGroupTree = false;
                objfrmReportViewer.Text = "Current Asset List";
                objfrmReportViewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }