using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Stimulsoft.Report; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using Stimulsoft.Report.Dictionary; using Stimulsoft.Report.Export; using Stimulsoft.Base.Services; using ns_MoneyFlow.DAL; using System.Web.Configuration; using System.Web.Security; using System.IO; using Stimulsoft.Report.Components; using Stimulsoft.Base.Drawing; using Stimulsoft.Report.Web; using System.Drawing; public partial class Default2 : System.Web.UI.Page { private StiReport report = new StiReport(); //public Stimulsoft.Report.Components.StiGroupHeaderBand grLiabPrim; //public DataSet dsBSReport; //public DataTable dtRepDet; //public DataTable dtUserPC; //public DataTable dtRepLiab; //public DataTable dtRepAsst; //public StiGroupHeaderBand ghbLiabSec; public StiText txtLiabPCSecAmt; protected void Page_Load(object sender, EventArgs e) { try { StiReport report = CreateReport2(); report.Render(); StiWebViewer1.Report = report; StiWebViewer1.ViewMode = StiWebViewMode.WholeReport; } catch (SqlException ex) { ErrorExtension ErrorExtension = new ErrorExtension(); ErrorExtension.ToLogString(ex, ""); Response.Redirect("ErrorPage.aspx?Error=2&Page=" + Page.Title); } catch (Exception ex) { ErrorExtension ErrorExtension = new ErrorExtension(); ErrorExtension.ToLogString(ex, ""); Response.Redirect("ErrorPage.aspx?Error=1&Page=" + Page.Title); } } public StiReport CreateReport2() { StiReport report = new StiReport(); StiPage MainRepPage = report.Pages[0]; MainRepPage.PaperSize = System.Drawing.Printing.PaperKind.Letter; MainRepPage.Orientation = StiPageOrientation.Landscape; // Add the main databand StiDataBand dbMain = new StiDataBand(new RectangleD(0, 0, MainRepPage.PageWidth, 2)); //dbMain.Height = 0.4; dbMain.Name = "stidbMain"; dbMain.Printable = true; dbMain.PrintOnAllPages = true; MainRepPage.Components.Add(dbMain); StiPage LiabRep = new StiPage(); LiabRep.PaperSize = System.Drawing.Printing.PaperKind.Custom; LiabRep.PageWidth = dbMain.Width / 2; //LiabRep.PageHeight = MainRepPage.PageHeight; LiabRep.Orientation = StiPageOrientation.Portrait; LiabRep.Margins.Top = MainRepPage.Margins.Top; LiabRep.Margins.Bottom = MainRepPage.Margins.Bottom; LiabRep.Margins.Left = 0; LiabRep.Margins.Right = 0; report.Pages.Add(LiabRep); StiPage AssetRep = new StiPage(); AssetRep.PaperSize = System.Drawing.Printing.PaperKind.Custom; AssetRep.PageWidth = dbMain.Width / 2; //LiabRep.PageHeight = MainRepPage.PageHeight; AssetRep.Orientation = StiPageOrientation.Portrait; AssetRep.Margins.Top = MainRepPage.Margins.Top; AssetRep.Margins.Bottom = MainRepPage.Margins.Bottom; AssetRep.Margins.Left = 0; AssetRep.Margins.Right = 0; report.Pages.Add(AssetRep); cs_GeneralLedger.cs_GLReports objBalanceSheetRep = new cs_GeneralLedger.cs_GLReports(); objBalanceSheetRep.Login = (string)Session["UserID"]; objBalanceSheetRep.LoginPassword = (string)Session["Password"]; cs_ConnectionString ConStr = new cs_ConnectionString(); DataSet dsBSReport = objBalanceSheetRep.m_BalanceSheetReport(11, "26/5/2013", "GL", true, "abc"); dsBSReport.Tables[0].TableName = "dtBSRepTitleDetails"; DataTable dtRepDet = dsBSReport.Tables[0]; dsBSReport.Tables[1].TableName = "dtBSUsersPCList"; DataTable dtUserPC = dsBSReport.Tables[1]; dsBSReport.Tables[2].TableName = "dtBSLiabs"; DataTable dtRepLiab = dsBSReport.Tables[2]; dsBSReport.Tables[3].TableName = "dtBSAssets"; DataTable dtRepAsst = dsBSReport.Tables[3]; report.RegData(dsBSReport); report.Dictionary.Synchronize(); //Create TitleBand StiHeaderBand TitleBand = new StiHeaderBand(); TitleBand.Height = 1; TitleBand.Name = "TitleBand"; MainRepPage.Components.Add(TitleBand); // Create Sub report for Liabilities StiSubReport SubRep1 = new StiSubReport(new RectangleD(0, 0, LiabRep.PageWidth , 1)); SubRep1.Name = "subLiabRep"; SubRep1.Page = LiabRep; //SubRep1.UseExternalReport = false; //SubRep1.KeepSubReportTogether = false; SubRep1.SubReportPageGuid = LiabRep.Guid; dbMain.Components.Add(SubRep1); double AssetL = dbMain.Width / 2; // Create Sub report for Assets StiSubReport SubRep2 = new StiSubReport(new RectangleD(AssetL, 0, AssetRep.PageWidth, 1)); SubRep2.Name = "subAssetRep"; SubRep2.Page = AssetRep; //SubRep1.UseExternalReport = false; //SubRep1.KeepSubReportTogether = false; SubRep2.SubReportPageGuid = AssetRep.Guid; dbMain.Components.Add(SubRep2); ////Create HeaderBand in Liabilities subreport //StiHeaderBand hbLiab = new StiHeaderBand(new RectangleD(0, 0, LiabRep.PageWidth, 1.2)); //hbLiab.Height = 1.2; //hbLiab.Name = "LiabHeaderBand"; //LiabRep.Components.Add(hbLiab); //StiPanel pnhbLiab = new StiPanel(new RectangleD(0, 0, LiabRep.PageWidth, 1.2)); //pnhbLiab.Height = 1.2; //hbLiab.Components.Add(pnhbLiab); double columnWidth = LiabRep.PageWidth / ((dtUserPC.Rows.Count + 2) * 2); double x = columnWidth * 2; double gap = x * 2 / 6; double pos = 0; //Create Databand in header band StiDataBand dbinhbLiab = new StiDataBand(new RectangleD(0, 0, LiabRep.PageWidth, 0.8)); ; //dbinhbLiab.DataSourceName = "dtBSLiabs"; dbinhbLiab.Height = 0.8; dbinhbLiab.Name = "LiabHeaderDataBand"; LiabRep.Components.Add(dbinhbLiab); StiDataBand dbinhbAsset = new StiDataBand(new RectangleD(0, 0, AssetRep.PageWidth, 0.8)); ; //dbinhbLiab.DataSourceName = "dtBSLiabs"; dbinhbAsset.Height = 0.8; dbinhbAsset.Name = "AssetHeaderDataBand"; AssetRep.Components.Add(dbinhbAsset); StiText txtLiabHdr = new StiText(new RectangleD(pos, 0, (x * 2), 0.7)); txtLiabHdr.Text.Value = "Liabilities"; txtLiabHdr.HorAlignment = StiTextHorAlignment.Center; txtLiabHdr.VertAlignment = StiVertAlignment.Center; txtLiabHdr.Name = "HeaderTextL"; txtLiabHdr.Border.Side = StiBorderSides.All; dbinhbLiab.Components.Add(txtLiabHdr); StiText txtAssetHdr = new StiText(new RectangleD(pos, 0, (x * 2), 0.7)); txtAssetHdr.Text.Value = "Assets"; txtAssetHdr.HorAlignment = StiTextHorAlignment.Center; txtAssetHdr.VertAlignment = StiVertAlignment.Center; txtAssetHdr.Name = "HeaderTextA"; txtAssetHdr.Border.Side = StiBorderSides.All; dbinhbAsset.Components.Add(txtAssetHdr); //------------------------------------------------------ Liabilities --------------------------------------------------// // Add Group Header band for primary accounts StiGroupHeaderBand ghbLiabPrim = new StiGroupHeaderBand();//new RectangleD(0, 1, LiabRep.PageWidth, 1)); ghbLiabPrim.Height = 0.3; ghbLiabPrim.Condition.Value = "{dtBSLiabs.PrimOrder}"; ghbLiabPrim.SortDirection = StiGroupSortDirection.Ascending; LiabRep.Components.Add(ghbLiabPrim); StiPanel pngrLiabPrim = new StiPanel(new RectangleD(0, 0, LiabRep.PageWidth,0.3)); ghbLiabPrim.Components.Add(pngrLiabPrim); StiDataBand dbgrhdrLiabPrim = new StiDataBand(); dbgrhdrLiabPrim.Height = 0.3; pngrLiabPrim.Components.Add(dbgrhdrLiabPrim); StiText txtLiabPrimAccts = new StiText(new RectangleD(0.05, 0, (x * 2), 0.3)); txtLiabPrimAccts.Text.Value = "{dtBSLiabs.PrimAcctHead}"; //txtLiabPrimAccts.Name = "LiabPrimAccts"; txtLiabPrimAccts.HorAlignment = StiTextHorAlignment.Left; txtLiabPrimAccts.VertAlignment = StiVertAlignment.Center; txtLiabPrimAccts.Border.Side = StiBorderSides.None; txtLiabPrimAccts.Type = StiSystemTextType.DataColumn; txtLiabPrimAccts.WordWrap = true; dbgrhdrLiabPrim.Components.Add(txtLiabPrimAccts); // Add group header band for secondary account heads StiGroupHeaderBand ghbLiabSec = new StiGroupHeaderBand(); ghbLiabSec.Height = 0.3; ghbLiabSec.Condition.Value = "{dtBSLiabs.AcctHead}"; ghbLiabSec.SortDirection = StiGroupSortDirection.Ascending; LiabRep.Components.Add(ghbLiabSec); StiPanel pngrLiabSec = new StiPanel(new RectangleD(0, 0, LiabRep.PageWidth, 0.3)); ghbLiabSec.Components.Add(pngrLiabSec); StiDataBand dbgrhdrLiabSec = new StiDataBand(); //LiabgrhdrdataBand.DataSourceName = ""; dbgrhdrLiabSec.Height = 0.3; //dbgrhdrLiabSec.Name = "LiabgrHdrDb"; pngrLiabSec.Components.Add(dbgrhdrLiabSec); StiText txtLiabSecAccts = new StiText(new RectangleD(gap, 0, (x * 2) - gap, 0.3)); txtLiabSecAccts.Text.Value = "{dtBSLiabs.AcctHead}"; //txtLiabSecAccts.Name = "LiabPrimAccts"; txtLiabSecAccts.HorAlignment = StiTextHorAlignment.Left; txtLiabSecAccts.VertAlignment = StiVertAlignment.Center; txtLiabSecAccts.Border.Side = StiBorderSides.None; txtLiabSecAccts.Type = StiSystemTextType.DataColumn; txtLiabSecAccts.WordWrap = true; dbgrhdrLiabSec.Components.Add(txtLiabSecAccts); //if (txtLiabSecAccts.Text.Value == txtLiabPrimAccts.Text.Value) //{ // ghbLiabSec.Enabled = false; // txtLiabSecAccts.Enabled = false; //} //else //{ // ghbLiabSec.Enabled = true; // txtLiabSecAccts.Enabled = true; //} //Add databand for Chart of Accounts StiDataBand dbLiabAccts = new StiDataBand();//new RectangleD(0, 3, LiabRep.PageWidth, 0.8)); ; dbLiabAccts.DataSourceName = "dtBSLiabs"; dbLiabAccts.Height = 0.3; //dbgrhdrLiabSec.Name = "LiabgrHdrDb"; LiabRep.Components.Add(dbLiabAccts); StiText txtLiabAccts = new StiText(new RectangleD(gap * 2, 0, (x * 2) - (gap * 2), 0.4)); txtLiabAccts.Text.Value = "{dtBSLiabs.CompAccName}"; //txtLiabSecAccts.Name = "LiabPrimAccts"; txtLiabAccts.HorAlignment = StiTextHorAlignment.Left; txtLiabAccts.VertAlignment = StiVertAlignment.Center; txtLiabAccts.Border.Side = StiBorderSides.None; txtLiabAccts.Type = StiSystemTextType.DataColumn; txtLiabAccts.WordWrap = true; txtLiabAccts.ShrinkFontToFit = true; dbLiabAccts.Components.Add(txtLiabAccts); //------------------------------------------------------------------------------------------------------------------------// //------------------------------------------------------ Assets --------------------------------------------------// // Add Group Header band for primary accounts StiGroupHeaderBand ghbAssetPrim = new StiGroupHeaderBand(); ghbAssetPrim.Height = 0.3; ghbAssetPrim.Condition.Value = "{dtBSAssets.PrimOrder}"; ghbAssetPrim.SortDirection = StiGroupSortDirection.Ascending; AssetRep.Components.Add(ghbAssetPrim); StiPanel pngrAssetPrim = new StiPanel(new RectangleD(0, 0, AssetRep.PageWidth, 0.3)); ghbAssetPrim.Components.Add(pngrAssetPrim); StiDataBand dbgrhdrAssetPrim = new StiDataBand(); dbgrhdrAssetPrim.Height = 0.3; pngrAssetPrim.Components.Add(dbgrhdrAssetPrim); StiText txtAssetPrimAccts = new StiText(new RectangleD(0.05, 0, (x * 2), 0.3)); txtAssetPrimAccts.Text.Value = "{dtBSAssets.PrimAcctHead}"; //txtLiabPrimAccts.Name = "LiabPrimAccts"; txtAssetPrimAccts.HorAlignment = StiTextHorAlignment.Left; txtAssetPrimAccts.VertAlignment = StiVertAlignment.Center; txtAssetPrimAccts.Border.Side = StiBorderSides.None; txtAssetPrimAccts.Type = StiSystemTextType.DataColumn; txtAssetPrimAccts.WordWrap = true; dbgrhdrAssetPrim.Components.Add(txtAssetPrimAccts); // Add group header band for secondary account heads StiGroupHeaderBand ghbAssetSec = new StiGroupHeaderBand(); ghbAssetSec.Height = 0.3; ghbAssetSec.Condition.Value = "{dtBSAssets.AcctHead}"; ghbAssetSec.SortDirection = StiGroupSortDirection.Ascending; AssetRep.Components.Add(ghbAssetSec); StiPanel pngrAssetSec = new StiPanel(new RectangleD(0, 0, AssetRep.PageWidth, 0.3)); ghbAssetSec.Components.Add(pngrAssetSec); StiDataBand dbgrhdrAssetSec = new StiDataBand(); dbgrhdrAssetSec.Height = 0.3; pngrAssetSec.Components.Add(dbgrhdrAssetSec); StiText txtAssetSecAccts = new StiText(new RectangleD(gap, 0, (x * 2) - gap, 0.3)); txtAssetSecAccts.Text.Value = "{dtBSAssets.AcctHead}"; txtAssetSecAccts.HorAlignment = StiTextHorAlignment.Left; txtAssetSecAccts.VertAlignment = StiVertAlignment.Center; txtAssetSecAccts.Border.Side = StiBorderSides.None; txtAssetSecAccts.Type = StiSystemTextType.DataColumn; txtAssetSecAccts.WordWrap = true; dbgrhdrAssetSec.Components.Add(txtAssetSecAccts); //if (txtAssetSecAccts.Text.Value == "") //{ // ghbAssetSec.Enabled = false; // ghbAssetSec.Height = 0; // pngrAssetSec.Height = 0; // dbgrhdrAssetSec.Height = 0; // txtAssetSecAccts.Enabled = false; // txtAssetSecAccts.Height = 0; //} //else //{ // ghbAssetSec.Enabled = true; // ghbAssetSec.Height = 0.3; // pngrAssetSec.Height = 0.3; // dbgrhdrAssetSec.Height = 0.3; // txtAssetSecAccts.Enabled = true; // txtAssetSecAccts.Height = 0.3; //} //Add databand for Chart of Accounts StiDataBand dbAssetAccts = new StiDataBand(); dbAssetAccts.DataSourceName = "dtBSAssets"; dbAssetAccts.Height = 0.3; AssetRep.Components.Add(dbAssetAccts); StiText txtAssetAccts = new StiText(new RectangleD(gap * 2, 0, (x * 2) - (gap * 2), 0.4)); txtAssetAccts.Text.Value = "{dtBSAssets.CompAccName}"; //txtLiabSecAccts.Name = "LiabPrimAccts"; txtAssetAccts.HorAlignment = StiTextHorAlignment.Left; txtAssetAccts.VertAlignment = StiVertAlignment.Center; txtAssetAccts.Border.Side = StiBorderSides.None; txtAssetAccts.Type = StiSystemTextType.DataColumn; txtAssetAccts.WordWrap = true; txtAssetAccts.ShrinkFontToFit = true; dbAssetAccts.Components.Add(txtAssetAccts); pos = pos + (x * 2); int i = 7; foreach (DataRow drUserPC in dtUserPC.Rows) { StiText txtLiabPChdr = new StiText(new RectangleD(pos, 0, x, 0.7)); txtLiabPChdr.Text.Value = drUserPC["ProfitCenter"].ToString() + System.Environment.NewLine + "Amt in Rs."; txtLiabPChdr.HorAlignment = StiTextHorAlignment.Center; txtLiabPChdr.VertAlignment = StiVertAlignment.Center; txtLiabPChdr.WordWrap = true; txtLiabPChdr.Border.Side = StiBorderSides.All; dbinhbLiab.Components.Add(txtLiabPChdr); StiText txtAssetPChdr = new StiText(new RectangleD(pos, 0, x, 0.7)); txtAssetPChdr.Text.Value = drUserPC["ProfitCenter"].ToString() + System.Environment.NewLine + "Amt in Rs."; txtAssetPChdr.HorAlignment = StiTextHorAlignment.Center; txtAssetPChdr.VertAlignment = StiVertAlignment.Center; txtAssetPChdr.WordWrap = true; txtAssetPChdr.Border.Side = StiBorderSides.All; dbinhbAsset.Components.Add(txtAssetPChdr); StiText txtLiabPCPrimAmt1 = new StiText(new RectangleD(pos, 0, columnWidth, 0.3)); txtLiabPCPrimAmt1.HorAlignment = StiTextHorAlignment.Right; txtLiabPCPrimAmt1.VertAlignment = StiVertAlignment.Center; txtLiabPCPrimAmt1.Border.Side = StiBorderSides.None; txtLiabPCPrimAmt1.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold); dbgrhdrLiabPrim.Components.Add(txtLiabPCPrimAmt1); StiText txtLiabPCPrimAmt2 = new StiText(new RectangleD(pos + columnWidth, 0, columnWidth, 0.3)); txtLiabPCPrimAmt2.HorAlignment = StiTextHorAlignment.Right; txtLiabPCPrimAmt2.VertAlignment = StiVertAlignment.Center; txtLiabPCPrimAmt2.Border.Side = StiBorderSides.None; txtLiabPCPrimAmt2.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold); dbgrhdrLiabPrim.Components.Add(txtLiabPCPrimAmt2); PrimAcctsGroupHeader_TextCondition(ghbLiabPrim, dtRepLiab, i, txtLiabPCPrimAmt2); StiText txtLiabPCSecAmt = new StiText(new RectangleD(pos, 0, columnWidth, 0.3)); txtLiabPCSecAmt.HorAlignment = StiTextHorAlignment.Right; txtLiabPCSecAmt.VertAlignment = StiVertAlignment.Center; txtLiabPCSecAmt.Border.Side = StiBorderSides.None; txtLiabPCSecAmt.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Underline); //txtLiabPCSecAmt.BeforePrint += new System.EventHandler(this.Text9_Conditions); //txtLiabPCSecAmt.BeforePrint += SecAcctsGroupHeader_TextCondition(ghbLiabSec, dtRepLiab, "{dtBSLiabs.n" + drUserPC["PC_Num"].ToString() + "}", txtLiabPCSecAmt); dbgrhdrLiabSec.Components.Add(txtLiabPCSecAmt); SecAcctsGroupHeader_TextCondition(ghbLiabSec, dtRepLiab, "{dtBSLiabs.n" + drUserPC["PC_Num"].ToString() + "}", txtLiabPCSecAmt); StiText txtLiabAcctAmt = new StiText(new RectangleD(pos, 0, columnWidth, 0.4)); txtLiabAcctAmt.HorAlignment = StiTextHorAlignment.Right; txtLiabAcctAmt.VertAlignment = StiVertAlignment.Center; txtLiabAcctAmt.Border.Side = StiBorderSides.None; txtLiabAcctAmt.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular); txtLiabAcctAmt.Text.Value = "{dtBSLiabs.n" + drUserPC["PC_Num"].ToString() + "}"; txtLiabAcctAmt.Type = StiSystemTextType.DataColumn; dbLiabAccts.Components.Add(txtLiabAcctAmt); //COAAccts_TextCondition(dtRepDet, dtRepLiab, i, txtLiabAcctAmt); i++; pos = pos + x; } return report; } private void COAAccts_TextCondition(DataTable dtRepDet, DataTable dtRepAmt, int i, StiText txtAcctAmt) { } private void PrimAcctsGroupHeader_TextCondition(StiGroupHeaderBand grPrimHdr,DataTable dtPrimAmt, int i, StiText stitxtPrimAcct) { if (Totals.Sum(grPrimHdr, report, dtPrimAmt.Columns[i].ColumnName) < 0) { ((Stimulsoft.Report.Components.IStiTextBrush)(stitxtPrimAcct)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red); ((Stimulsoft.Report.Components.IStiBrush)(stitxtPrimAcct)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent); Stimulsoft.Report.Components.StiConditionHelper.ApplyFont(stitxtPrimAcct, new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0), Stimulsoft.Report.Components.StiConditionPermissions.All); ((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border = ((Stimulsoft.Base.Drawing.StiBorder)(((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border.Clone())); ((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border.Side = Stimulsoft.Base.Drawing.StiBorderSides.None; ((Stimulsoft.Report.Components.StiComponent)(stitxtPrimAcct)).Enabled = true; ((Stimulsoft.Report.Components.StiText)(stitxtPrimAcct)).TextValue = "(" + (Totals.Sum(grPrimHdr, report, dtPrimAmt.Columns[i].ColumnName) * -1).ToString() + ")"; return; } if (Totals.Sum(grPrimHdr, report, dtPrimAmt.Columns[i].ColumnName) >= 0) { ((Stimulsoft.Report.Components.IStiTextBrush)(stitxtPrimAcct)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black); ((Stimulsoft.Report.Components.IStiBrush)(stitxtPrimAcct)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent); Stimulsoft.Report.Components.StiConditionHelper.ApplyFont(stitxtPrimAcct, new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0), Stimulsoft.Report.Components.StiConditionPermissions.All); ((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border = ((Stimulsoft.Base.Drawing.StiBorder)(((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border.Clone())); ((Stimulsoft.Report.Components.IStiBorder)(stitxtPrimAcct)).Border.Side = Stimulsoft.Base.Drawing.StiBorderSides.None; ((Stimulsoft.Report.Components.StiComponent)(stitxtPrimAcct)).Enabled = true; ((Stimulsoft.Report.Components.StiText)(stitxtPrimAcct)).TextValue = Totals.Sum(grPrimHdr, report, dtPrimAmt.Columns[i].ColumnName).ToString(); return; } } //public void GetTotal19(object sender, Stimulsoft.Report.Events.StiValueEventArgs e) //{ // e.Value = dtRepLiab.Columns[9]; //} private void SecAcctsGroupHeader_TextCondition(StiGroupHeaderBand grSecHdr, DataTable dtSecAmt, string i, StiText stitxtSecAcct) // public void Text9_Conditions(object sender, System.EventArgs e) { // if (Totals.Sum(ghbLiabSec, report, "GetTotal19") >= 0) if (Totals.Sum(grSecHdr, report, i) >= 0) { ((Stimulsoft.Report.Components.IStiTextBrush)(stitxtSecAcct)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black); ((Stimulsoft.Report.Components.IStiBrush)(stitxtSecAcct)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent); Stimulsoft.Report.Components.StiConditionHelper.ApplyFont(stitxtSecAcct, new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Underline), Stimulsoft.Report.Components.StiConditionPermissions.All); ((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border = ((Stimulsoft.Base.Drawing.StiBorder)(((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border.Clone())); ((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border.Side = Stimulsoft.Base.Drawing.StiBorderSides.None; ((Stimulsoft.Report.Components.StiComponent)(stitxtSecAcct)).Enabled = true; ((Stimulsoft.Report.Components.StiText)(stitxtSecAcct)).TextValue = (Totals.Sum(grSecHdr, report, i)).ToString(); return; } if (Totals.Sum(grSecHdr, report, i) < 0) { ((Stimulsoft.Report.Components.IStiTextBrush)(stitxtSecAcct)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red); ((Stimulsoft.Report.Components.IStiBrush)(stitxtSecAcct)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent); Stimulsoft.Report.Components.StiConditionHelper.ApplyFont(stitxtSecAcct, new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Underline), Stimulsoft.Report.Components.StiConditionPermissions.All); ((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border = ((Stimulsoft.Base.Drawing.StiBorder)(((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border.Clone())); ((Stimulsoft.Report.Components.IStiBorder)(stitxtSecAcct)).Border.Side = Stimulsoft.Base.Drawing.StiBorderSides.None; ((Stimulsoft.Report.Components.StiComponent)(stitxtSecAcct)).Enabled = true; ((Stimulsoft.Report.Components.StiText)(stitxtSecAcct)).TextValue = (Totals.Sum(grSecHdr, report, i) * -1).ToString(); return; } } }