Ejemplo n.º 1
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     crAssetCosting rpt = new crAssetCosting();
     rpt.Site = this.Site;
     return rpt;
 }
Ejemplo n.º 2
0
		public static void printAssetCosts(Main frmMain, DateTime dFromDate, DateTime dToDate,string sCompanyName,string sReportHeader, DataSet dsAssetCosts)
		{
			using (Solsage_Process_Management_System.Documents.crAssetCosting reportAssetCost = new Solsage_Process_Management_System.Documents.crAssetCosting())
			{
				using (Solsage_Process_Management_System.Documents.PrintInvoice frmPrint = new Solsage_Process_Management_System.Documents.PrintInvoice())
				{                    
					reportAssetCost.SetDataSource(dsAssetCosts.Tables["Costs"]);

					foreach (CrystalDecisions.CrystalReports.Engine.FormulaFieldDefinition forReport in reportAssetCost.DataDefinition.FormulaFields)
					{
						switch (forReport.FormulaName)
						{
							case "{@FromDate}":
								forReport.Text = "'" + dFromDate.ToString("yyyy-MM-dd") + "'";
								break;
							case "{@ToDate}":
								forReport.Text = "'" + dToDate.ToString("yyyy-MM-dd") + "'";
								break;
							case "{@sCompanyName}":
								forReport.Text = "'" + sCompanyName + "'";
								break;
							case "{@sReportHeading}":
								forReport.Text = "'" + sReportHeader + "'";
								break;
						}
					}

					frmPrint.crystalReportViewer1.ReportSource = reportAssetCost;
					frmPrint.printThisDocument();
				}
			}
		}