using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ns_MoneyFlow.DAL; using Stimulsoft.Controls; using Stimulsoft.Base; using Stimulsoft.Report; using System.Data; using Stimulsoft.Report.Components; using System.Data.SqlClient; using System.IO; public partial class General_Ledger_Reports_BalanceSheetReport1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { 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(); string SqldBConnectString = ConStr.ConnectionString; StiReport report = new StiReport(); report.Dictionary.Clear(); report.Dictionary.Databases.Clear(); report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("SQLConnection", SqldBConnectString)); DataSet dsBSReport = objBalanceSheetRep.m_BalanceSheetReport(11, "1/5/2013", "GL", false, "abc"); report.Load(HttpContext.Current.Request.MapPath("General-Ledger\\Reports\\StimReports\\BS_Horz_NoPC.mrt")); dsBSReport.Tables[0].TableName = "dtBSRepTitleDetails"; dsBSReport.Tables[1].TableName = "dtBSRepLiabs"; dsBSReport.Tables[2].TableName = "dtBSRepAssets"; report.DataSources.Clear(); report.RegData(dsBSReport.Tables["dtBSRepTitleDetails"]); report.RegData(dsBSReport.Tables["dtBSRepLiabs"]); report.RegData(dsBSReport.Tables["dtBSRepAssets"]); report.Dictionary.Synchronize(); DataTable dt = dsBSReport.Tables[0]; DataRow dr = dt.Rows[0]; //((Stimulsoft.Report.Components.StiImage)report.GetComponentByName("stiImgCompLogo")).Image = Stimulsoft.Base.Drawing.StiImageFromURL.LoadBitmap(System.Web.VirtualPathUtility.MakeRelative(System.Web.HttpContext.Current.Request.CurrentExecutionFilePath, dr["CompLogoPath"].ToString())); if (dr["CompLogoPath"].ToString() != "") { if (File.Exists(Server.MapPath(dr["CompLogoPath"].ToString()))) { ((Stimulsoft.Report.Components.StiImage)report.GetComponentByName("stiImgCompLogo")).Image = Stimulsoft.Base.Drawing.StiImageFromURL.LoadBitmap(Server.MapPath(dr["CompLogoPath"].ToString())); } } if (Convert.ToBoolean(dr["DispPrevYrFig"].ToString()) == false) { ((Stimulsoft.Report.Components.StiText)report.GetComponentByName("stitxtPrevYrLiab")).Enabled = false; ((Stimulsoft.Report.Components.StiText)report.GetComponentByName("stitxtPrevYrAsset")).Enabled = false; ((Stimulsoft.Report.Components.StiVerticalLinePrimitive)report.GetComponentByName("stiVlpPrevYrBalLiab")).Enabled = false; ((Stimulsoft.Report.Components.StiVerticalLinePrimitive)report.GetComponentByName("stiVlpPrevYrBalAsset")).Enabled = false; } report.Render(); StiWebViewer1.ZoomPercent = 75; StiWebViewer1.Report = report; } }