internal override int RenderHeader(Rdl.Render.Container box, Rdl.Runtime.Context context, int column) { for (int i = 0; i < _staticColumns.Count; i++) { ReportItems item = _staticColumns[i]; Rdl.Render.FixedContainer contentBox = null; if (box != null) { contentBox = box.AddFixedContainer(this, Style, context); contentBox.Name = "StaticColumnContent"; contentBox.Height = Height.points; contentBox.MatchParentHeight = true; contentBox.Width = FindMatrix(this).Columns[i].Width; contentBox.CanGrowVertically = false; } item.Render(contentBox, context); } if (RenderNext != null && RenderNext is RowGrouping) { column = ((ColumnGrouping)RenderNext).RenderHeader(box, context, column); } else if (RenderNext != null) { column++; } return(column); }
public Rectangle(ReportDefn r, ReportLink p, XmlNode xNode):base(r,p,xNode) { _ReportItems=null; _PageBreakAtStart=false; _PageBreakAtEnd=false; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "PageBreakAtStart": _PageBreakAtStart = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "PageBreakAtEnd": _PageBreakAtEnd = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (ReportItemElement(xNodeLoop)) // try at ReportItem level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Rectangle element " + xNodeLoop.Name + " ignored."); break; } } }
/// <summary> /// Инициализировать доступный контент пользователя. /// </summary> public void Init(UserData userData, DataAccess dataAccess) { if (userData == null) { throw new ArgumentNullException("userData"); } try { reportItemDict.Clear(); dataWndItemDict.Clear(); ReportItems.Clear(); DataWndItems.Clear(); AddContentFromBase(userData.UserRights, userData.UiObjSpecs, dataAccess); AddContentFromPlugins(userData.PluginSpecs); ReportItems.Sort(); DataWndItems.Sort(); } catch (Exception ex) { log.WriteException(ex, Localization.UseRussian ? "Ошибка при инициализации доступного контента пользователя" : "Error initializing accessible user content"); } }
protected override void ParseAttribute(XmlNode attr) { base.ParseAttribute(attr); switch (attr.Name.ToLower()) { case "grouping": _grouping = new Grouping(attr, this); break; case "sorting": foreach (XmlNode child in attr.ChildNodes) { _sorting.Add(new SortBy(child, this)); } break; case "subtotal": _subtotal = new Subtotal(attr, this); break; case "reportitems": _reportItems = new ReportItems(attr, this); break; case "visibility": _visibility = new Visibility(attr, this); break; default: break; } }
public ActionResult rptDailyOperatorGross(ReportItems model) { var operatorName = _user.OperatorName; var strDateRec = model.DateRec; var strForDraw = model.ForDraw; var DrawResult = model.DrawResult; var AgentID = model.AgentID; List <rptDailyOperatorGross> rptData = null; var strQuery = "SELECT [DateRec]" + " ,[OperatorName] " + " ,[GrossAmt] " + " ,[DrawDate] " + " ,[PayoutAmt] " + " ,[BalAmt] " + " FROM[SMSSys].[dbo].[rptDailyOperatorGross] " + " WHERE [OperatorName] = @OperatorName" + " AND [DateRec] = @DateRec "; rptData = dbContext.Database.SqlQuery <rptDailyOperatorGross>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("DateRec", strDateRec)).ToList(); rptData.ForEach(x => x.PersonViewed = operatorName); rptData.OrderBy(x => x.OperatorName); //Sorting Reports.rptDailyOperatorGross report = new Reports.rptDailyOperatorGross(); report.DataSource = rptData as IEnumerable <rptDailyOperatorGross>; Session[s_rptDailyAgentGross] = report; return(PartialView()); }
string _TableSyntax; // syntax for the table position; table contains {x} items holding a // spot for each _ris; public TablePositioner(Report rpt, ReportItems ris) { _rpt = rpt; _ris = ris; _values = new string[ris.Items.Count]; _TableSyntax = BuildTable(); }
private void PostaviIzvjestaj(DataSet ds) { DataTable dt = ds.Tables[0]; this.reportViewer1.Reset(); this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(dt.TableName, dt)); ReportBuilder reportBuilder = new ReportBuilder(); reportBuilder.DataSource = ds; reportBuilder.Page = new ReportPage(); ReportSections reportFooter = new ReportSections(); ReportItems reportFooterItems = new ReportItems(); ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3]; footerTxt[0] = new ReportTextBoxControl() { Name = "txtCopyright", ValueOrExpression = new string[] { string.Format("Copyright {0}", DateTime.Now.Year) } }; footerTxt[1] = new ReportTextBoxControl() { Name = "ExecutionTime", ValueOrExpression = new string[] { "Izvjestaj generiran " + DateTime.Now.ToString() } }; footerTxt[2] = new ReportTextBoxControl() { Name = "PageNumber", ValueOrExpression = new string[] { "Stranica ", ReportGlobalParameters.CurrentPageNumber, " of ", ReportGlobalParameters.TotalPages } }; reportFooterItems.TextBoxControls = footerTxt; reportFooter.ReportControlItems = reportFooterItems; reportBuilder.Page.ReportFooter = reportFooter; ReportSections reportHeader = new ReportSections(); reportHeader.Size = new ReportScale(); reportHeader.Size.Height = 0.05; ReportItems reportHeaderItems = new ReportItems(); ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1]; headerTxt[0] = new ReportTextBoxControl() { Name = "txtReportTitle", ValueOrExpression = new string[] { "Stanje na dan : " + DateTime.Now.ToString() } }; reportHeaderItems.TextBoxControls = headerTxt; reportHeader.ReportControlItems = reportHeaderItems; reportBuilder.Page.ReportHeader = reportHeader; this.reportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder)); this.reportViewer1.RefreshReport(); }
public void Add(ReportItemState reportItemState, string message, string elaboration = null) { ReportItems.Add(new ReportItem { State = reportItemState, Header = message, Elaboration = elaboration }); }
public ReportItem Create(string message) { var item = new ReportItem { Header = message }; ReportItems.Add(item); return(item); }
bool _InTableFooter; // true if tablecell is part of footer; simplifies HTML processing public TableCell(ReportDefn r, ReportLink p, XmlNode xNode, int colIndex) : base(r, p) { _ColIndex = colIndex; _ReportItems=null; _ColSpan=1; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "ColSpan": _ColSpan = XmlUtil.Integer(xNodeLoop.InnerText); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown TableCell element '" + xNodeLoop.Name + "' ignored."); break; } } // Must have exactly one ReportItems if (_ReportItems == null) OwnerReport.rl.LogError(8, "ReportItems element is required with a TableCell but not specified."); else if (_ReportItems.Items.Count != 1) OwnerReport.rl.LogError(8, "Only one element in ReportItems element is allowed within a TableCell."); // Obtain the tablecell's owner table; // determine if tablecell is part of table header _InTableHeader = false; ReportLink rl; for (rl=this.Parent; rl != null; rl=rl.Parent) { if (rl is Table) { _OwnerTable = (Table) rl; break; } if (rl is Header && rl.Parent is Table) // Header and parent is Table (not TableGroup) { _InTableHeader=true; } if (rl is Footer && rl.Parent is Table) // Header and parent is Table (not TableGroup) { _InTableFooter=true; } } return; }
protected override void ParseAttribute(XmlNode attr) { base.ParseAttribute(attr); switch (attr.Name.ToLower()) { case "corner": _corner = new ReportItems(attr.ChildNodes[0], this); break; case "columngroupings": foreach (XmlNode child in attr.ChildNodes) { _columnGroupings.Add(ColumnGrouping.GetColumnGrouping(child, this)); } break; case "rowgroupings": foreach (XmlNode child in attr.ChildNodes) { _rowGroupings.Add(RowGrouping.GetRowGrouping(child, this)); } break; case "matrixrows": _matrixRows = new Rows(attr, this); break; case "matrixcolumns": foreach (XmlNode child in attr.ChildNodes) { _columns.Add(new Column(child, this)); } break; case "layoutdirection": _layoutDirection = (LayoutDirectionEnum)Enum.Parse(typeof(LayoutDirectionEnum), attr.InnerText); break; case "groupsbeforerowheaders": _groupsBeforeRowHeaders = int.Parse(attr.InnerText); break; case "celldataelementname": _cellDataElementName = attr.InnerText; break; case "celldataelementoutput": _cellDataElementOutput = (CellDataElementOutputEnum)Enum.Parse(typeof(CellDataElementOutputEnum), attr.InnerText); break; default: break; } }
public ActionResult rptOperatorGross(ReportItems model) { var operatorName = _user.OperatorName; var strDateRec = model.DateRec; var strForDraw = model.ForDraw; var agentID = model.AgentID; var DrawResult = model.DrawResult; try { List <rptOperatorGross> rptData = null; var strQuery = "SELECT [DateRec],[TotalStr],[TotalRam],[ForDraw]" + ",[OperatorName],[AgentName],[DrawResult],[AgentCode],[TotalBet]" + ",[DrawDate] FROM[SMSSys].[dbo].[rptOperatorGross] " + "WHERE [OperatorName] = @OperatorName " + " AND DateRec = @DateRec " + " AND DrawResult = @DrawResult " + " AND ForDraw = @ForDraw"; if (agentID != null) { var AgentCode = getAgentCode(agentID); strQuery = strQuery + " AND [AgentName] = @AgentName"; rptData = dbContext.Database.SqlQuery <rptOperatorGross>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("AgentName", AgentCode), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec), new SqlParameter("ForDraw", strForDraw)) .ToList(); } else { rptData = dbContext.Database.SqlQuery <rptOperatorGross>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec), new SqlParameter("ForDraw", strForDraw)) .ToList(); } rptData.ForEach(x => x.PersonViewed = operatorName); rptData.OrderBy(x => x.OperatorName).OrderBy(x => x.AgentName).OrderBy(x => x.AgentCode); Reports.rptOperatorGross report = new Reports.rptOperatorGross(); report.DataSource = rptData as IEnumerable <rptOperatorGross>; Session[s_rptOperatorGross] = report; return(PartialView()); } catch (Exception ex) { var x = ex.Message; throw; } }
protected override MachineState RunCode(MachineState machineState, Byte[] instructionBytes) { for (UInt32 i = 0; i < actualReportItemCount; i++) { ReportItems.Add(new ReportItem(i, false)); } machineState.InstructionPointer += (UInt32)instructionBytes.Length; return(machineState); }
/// <summary> /// Write ReportItems, Height /// </summary> /// <param name="xmlWriter"></param> public virtual void WriteTo(XmlWriter xmlWriter) { if (ReportItems.Count > 0) { ReportItems.WriteTo(xmlWriter); } if (Height.HasValue) { xmlWriter.WriteElementString("Height", Height.ToString()); } }
protected override void ParseAttribute(XmlNode attr) { switch (attr.Name.ToLower()) { case "reportitems": _reportItems = new ReportItems(attr, this); break; default: break; } }
public void Update() { if (ReportItems != null && ReportItems.Any()) { var deleteItems = new List <ReportItem>(ReportItems.Where(x => x != null && x.Delete)); foreach (var reportItem in deleteItems) { ReportItems.Remove(reportItem); } State = CalculateState(); } }
public ActionResult rptWinningBetAgent(ReportItems model) { var operatorID = _user.OperatorID; var operatorName = _user.OperatorName; var AgentID = model.AgentID; var DateReceived = DateRecToDateRecieved(model.DateRec); var DrawResult = model.DrawResult; var ForDraw = model.ForDraw; //Time List <rptWinningBetAgent> rptData = null; var strQuery = "SELECT [DateReceived],[StrBet],[RamBet],[TotalAmt],[OperatorMobile],[ForDraw],[AgentName],[DrawResult],[MobileNo]" + ",[OperatorName],[AgentCode],[WonCnt],[WonStr],[WonRam] FROM [dbo].[rptWinningBetAgent]" + " WHERE OperatorName = @OperatorName" + " AND [DateReceived] = @DateReceived " + " AND [DrawResult] = @DrawResult " + " AND [ForDraw] = @ForDraw" + " AND [TotalAmt] > 0 "; if (AgentID != null) { var agentCode = getAgentCode(AgentID); //Agent Name strQuery = strQuery + " AND [AgentName] = @AgentName "; //Agent Code Filter rptData = dbContext.Database.SqlQuery <rptWinningBetAgent>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("DateReceived", DateReceived), new SqlParameter("AgentName", agentCode), new SqlParameter("DrawResult", DrawResult), new SqlParameter("ForDraw", ForDraw)) .ToList(); } else { rptData = dbContext.Database.SqlQuery <rptWinningBetAgent>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("DateReceived", DateReceived), new SqlParameter("DrawResult", DrawResult), new SqlParameter("ForDraw", ForDraw)) .ToList(); } rptData.ForEach(x => x.PersonViewed = operatorName); rptData.OrderBy(x => x.OperatorName).OrderBy(x => x.AgentName).OrderBy(x => x.AgentCode); //Sorting Reports.XtraReport1 r_rptWinningAgentBet = new Reports.XtraReport1(); r_rptWinningAgentBet.DataSource = rptData as IEnumerable <rptWinningBetAgent>; Session[s_rptWinningBetAgent] = r_rptWinningAgentBet; return(PartialView()); }
private ReportItemState CalculateState() { if (ReportItems.Any(x => x != null && x.State == ReportItemState.Failure)) { return(ReportItemState.Failure); } if (ReportItems.Any(x => x != null && x.State == ReportItemState.Warning)) { return(ReportItemState.Warning); } return(ReportItemState.Success); }
public ActionResult rptAgentBetDetail(ReportItems model) { var operatorID = _user.OperatorID; var operatorName = _user.OperatorName; var strDateRec = model.DateRec; var strForDraw = model.ForDraw; var AgentID = model.AgentID; var DrawResult = model.DrawResult; List <rptAgentBetDetail> rptData = null; var strQuery = "SELECT [DateRec],[StraightAmtBet],[RambolAmtBet],[ForDraw],[OperatorName],[AgentNameCode],[DrawResult]" + ",[TotalBet],[DrawDate],[CombinationNo],[AgentName],[ReceivedDate]" + " FROM [SMSSys].[dbo].[rptAgentBetDetail] " + " WHERE OperatorName=@OperatorName " + " AND DateRec = @DateRec " + " AND DrawResult = @DrawResult " + " AND ForDraw = @ForDraw "; if (AgentID != null) { var agentCode = getAgentCode(model.AgentID); strQuery = strQuery + " AND [AgentName] = @AgentName "; rptData = dbContext.Database.SqlQuery <rptAgentBetDetail>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("AgentName", agentCode), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec), new SqlParameter("ForDraw", strForDraw)) .OrderBy(x => x.ReceivedDate).ToList(); } else { rptData = dbContext.Database.SqlQuery <rptAgentBetDetail>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec), new SqlParameter("ForDraw", strForDraw)) .OrderBy(x => x.ReceivedDate).ToList(); } rptData.ForEach(x => x.PersonViewed = operatorName); rptData.OrderBy(x => x.OperatorName).OrderBy(x => x.AgentName).OrderBy(x => x.ReceivedDate); Reports.rptBetAgentDetails report = new Reports.rptBetAgentDetails(); report.DataSource = rptData as IEnumerable <rptAgentBetDetail>; Session[s_rtpAgentBetDetail] = report; return(PartialView()); }
protected override void ParseAttribute(XmlNode attr) { switch (attr.Name.ToLower()) { case "reportitems": _reportItems = new ReportItems(attr, this); break; case "colspan": _colSpan = Int16.Parse(attr.InnerText); break; default: break; } }
public async void Load() { var dialogs = UserDialogs.Instance; dialogs.ShowLoading(); await Task.Delay(500); ReportItems.Clear(); List <ReportItem> items = ReportItemDatabase.ListReportsOrdered(DateControl.Month, DateControl.Year); foreach (var item in items) { ReportItems.Add(item); } dialogs.HideLoading(); }
Visibility _Visibility; // Indicates if all of the dynamic rows for this grouping // should be hidden and replaced with a subtotal row for // this grouping scope public DynamicRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Grouping=null; _Sorting=null; _Subtotal=null; _ReportItems=null; _Visibility=null; // Run thru the attributes // foreach(XmlAttribute xAttr in xNode.Attributes) // { // } // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Grouping": _Grouping = new Grouping(r, this, xNodeLoop); break; case "Sorting": _Sorting = new Sorting(r, this, xNodeLoop); break; case "Subtotal": _Subtotal = new Subtotal(r, this, xNodeLoop); break; case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "Visibility": _Visibility = new Visibility(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown DynamicRow element '" + xNodeLoop.Name + "' ignored."); break; } } if (_Grouping == null) OwnerReport.rl.LogError(8, "DynamicRows requires the Grouping element."); if (_ReportItems == null || _ReportItems.Items.Count != 1) OwnerReport.rl.LogError(8, "DynamicRows requires the ReportItems element defined with exactly one report item."); }
public ActionResult rptOperatorGrossCurrent(ReportItems model) { var operatorName = _user.OperatorName; var strDateRec = model.DateRec; var strForDraw = model.ForDraw; var DrawResult = model.DrawResult; var AgentID = model.AgentID; List <rptOperatorGrossCurrent> rptData = null; var strQuery = "SELECT TOP 1000 [DateRec],[TotalStr],[TotalRam]" + ",[ForDraw],[OperatorName],[AgentName],[DrawResult]" + ",[AgentCode],[TotalBet],[DrawDate] " + " FROM[SMSSys].[dbo].[rptOperatorGrossCurrent]" + " WHERE [OperatorName] = @OperatorName" + " AND [ForDraw] = @ForDraw " + " AND [DrawResult] = @DrawResult " + " AND [DateRec] = @DateRec "; if (AgentID != null) { var AgentCode = getAgentCode(AgentID); strQuery = strQuery + " AND [AgentName] = @AgentName "; rptData = dbContext.Database.SqlQuery <rptOperatorGrossCurrent>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("AgentName", AgentCode), new SqlParameter("ForDraw", strForDraw), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec)).ToList(); } else { rptData = dbContext.Database.SqlQuery <rptOperatorGrossCurrent>(strQuery, new SqlParameter("OperatorName", operatorName), new SqlParameter("ForDraw", strForDraw), new SqlParameter("DrawResult", DrawResult), new SqlParameter("DateRec", strDateRec)).ToList(); } rptData.ForEach(x => x.PersonViewed = operatorName); rptData.OrderBy(x => x.OperatorName).OrderBy(x => x.AgentName).OrderBy(x => x.AgentCode); //Sorting Reports.rptOperatorGrossCurrent report = new Reports.rptOperatorGrossCurrent(); report.DataSource = rptData as IEnumerable <rptOperatorGrossCurrent>; Session[s_rptOperatorGrossCurrent] = report; return(PartialView()); }
internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context) { if (_staticRows.Count > FindMatrix(this).Rows.Count) { throw new Exception("There are more static row elements defined in matrix " + FindMatrix(this).Name + " than there are data rows."); } Rdl.Render.FlowContainer contentBox = null; if (box != null) { contentBox = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown); contentBox.Name = "StaticRowContent"; contentBox.Width = Width.points; contentBox.MatchParentWidth = true; contentBox.CanGrowVertically = true; } for (int i = 0; i < _staticRows.Count; i++) { Rdl.Render.FixedContainer cellBox = null; if (contentBox != null) { cellBox = contentBox.AddFixedContainer(this, Style, context); cellBox.Name = "StaticRowCell"; cellBox.Height = FindMatrix(this).Rows[i].Height.points; cellBox.MatchParentWidth = true; } ReportItems item = _staticRows[i]; item.Render(cellBox, context); } if (RenderNext != null) { if (RenderNext is ColumnGrouping) { ((ColumnGrouping)RenderNext).Render(box, FindMatrix(this).Context, context, 0); } else { RenderNext.Render(box, context); } } }
public CustomReportItem(ReportDefn r, ReportLink p, XmlNode xNode):base(r, p, xNode, false) { _Type=null; ReportItems ris=null; bool bVersion2 = true; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Type": _Type = xNodeLoop.InnerText; break; case "ReportItems": // Version 1 of the specification ris = new ReportItems(r, this, xNodeLoop); bVersion2 = false; break; case "AltReportItem": // Verstion 2 of the specification ris = new ReportItems(r, this, xNodeLoop); break; case "CustomProperties": _Properties = CustomProperties(xNodeLoop); break; default: if (ReportItemElement(xNodeLoop)) // try at ReportItem level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown CustomReportItem element " + xNodeLoop.Name + " ignored."); break; } } ReportItems = ris; if (bVersion2 && ris != null) { if (ris.Items.Count != 1) OwnerReport.rl.LogError(8, "Only one element is allowed within an AltReportItem."); } if (_Type == null) OwnerReport.rl.LogError(8, "CustomReportItem requires the Type element."); }
/// <summary> /// Добавление контента, доступного всем, который задаётся спецификациями плагинов. /// </summary> protected void AddContentFromPlugins(List <PluginSpec> pluginSpecs) { if (pluginSpecs != null) { foreach (PluginSpec pluginSpec in pluginSpecs) { // добавление общедоступных элементов отчётов if (pluginSpec.ReportSpecs != null) { foreach (ReportSpec reportSpec in pluginSpec.ReportSpecs) { if (reportSpec.ForEveryone) { ReportItems.Add(new ReportItem() { Text = reportSpec.Name, Url = reportSpec.Url, ReportSpec = reportSpec }); } } } // добавление общедоступных элементов окон данных if (pluginSpec.DataWndSpecs != null) { foreach (DataWndSpec dataWndSpec in pluginSpec.DataWndSpecs) { if (dataWndSpec.ForEveryone) { DataWndItems.Add(new DataWndItem() { Text = dataWndSpec.Name, Url = dataWndSpec.Url, DataWndSpec = dataWndSpec }); } } } } } }
ReportItems _ReportItems; // The region that contains the elements of the corner layout // This ReportItems collection must contain exactly // one ReportItem. The Top, Left, Height and Width // for this ReportItem are ignored. The position is // taken to be 0, 0 and the size to be 100%, 100%. public Corner(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _ReportItems=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Corner element '" + xNodeLoop.Name + "' ignored."); break; } } }
private void OnExport(object parameter) { SaveFileDialog file = new SaveFileDialog(); file.Filter = "excel文件|*.xls"; if (file.ShowDialog() == true) { using (var stream = file.OpenFile()) { var bytes = System.Text.Encoding.UTF8.GetBytes(ReportItems.CreateTable()); stream.Write(bytes, 0, bytes.Length); } if (MessageBox.Show("导出文件完成,是否需要打开?", "打开文件", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes) { System.Diagnostics.Process.Start(file.FileName); } } }
ReportItems _ReportItems; // The elements of the row header layout // This ReportItems collection must contain exactly one // ReportItem. The Top, Left, Height and Width for this // ReportItem are ignored. The position is taken to be 0, // 0 and the size to be 100%, 100%. public StaticRow(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _ReportItems=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; default: break; } } if (_ReportItems == null) OwnerReport.rl.LogError(8, "StaticRow requires the ReportItems element."); }
List<Textbox> _GrowList; // list of TextBox's that need to be checked for growth public List(ReportDefn r, ReportLink p, XmlNode xNode):base(r,p,xNode) { _Grouping=null; _Sorting=null; _ReportItems=null; _DataInstanceName="Item"; _DataInstanceElementOutput=DataInstanceElementOutputEnum.Output; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Grouping": _Grouping = new Grouping(r, this, xNodeLoop); break; case "Sorting": _Sorting = new Sorting(r, this, xNodeLoop); break; case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "DataInstanceName": _DataInstanceName = xNodeLoop.InnerText; break; case "DataInstanceElementOutput": _DataInstanceElementOutput = Oranikle.Report.Engine.DataInstanceElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown List element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion }
Style _Style; // Style information for the page footer public PageFooter(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Height=null; _PrintOnFirstPage=false; _PrintOnLastPage=false; _ReportItems=null; _Style=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Height": _Height = new RSize(r, xNodeLoop); break; case "PrintOnFirstPage": _PrintOnFirstPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "PrintOnLastPage": _PrintOnLastPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "Style": _Style = new Style(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown PageFooter element '" + xNodeLoop.Name + "' ignored."); break; } } if (_Height == null) OwnerReport.rl.LogError(8, "PageFooter Height is required."); }
protected override void ParseAttribute(XmlNode attr) { switch (attr.Name.ToLower()) { case "reportitems": _reportItems = new ReportItems(attr, Parent); break; case "style": _style = new Style(attr, this); break; case "position": _position = (PositionEnum)Enum.Parse(typeof(PositionEnum), attr.InnerText); break; case "dataelementname": _dataElementName = attr.InnerText; break; case "dataelementoutput": _dataElementOutput = (DataElementOutputEnum)Enum.Parse(typeof(DataElementOutputEnum), attr.InnerText); break; default: break; } }
private async Task setItemsAsync() { IsBusy = true; ReportItems.Clear(); ObservableCollection <ReportItem> allReports = null; try { // if select groupid, get reports referensed group if (!string.IsNullOrWhiteSpace(TargetGroupId)) { //allReports = await CustomFunction.Get<ObservableCollection<ReportItem>> // ($"api/values/reportsbygroup/{TargetGroupId}/{this.CurrentDate.Year}/{this.CurrentDate.Month}"); allReports = await ReportGroupManager.DefaultManager.GetReportsByGroup (TargetGroupId, CurrentDate.Year, CurrentDate.Month); } // default else { allReports = await ReportManager.DefaultManager.GetItemsAsync(this.CurrentDate.Year, this.CurrentDate.Month); } } catch (Exception e) { DebugUtil.WriteLine("UserReportListViewModel > " + e.Message); } if (allReports != null) { foreach (var item in allReports) { ReportItems.Add(item); } } IsBusy = false; }
public List <string> GetTitles() { return(ReportItems.Select(reportItem => reportItem.Name).ToList()); }
private Rdl.ReportItemsType CreateReportItems() { ReportItems reportItems = new ReportItems(); TableRdlGenerator tableGen = new TableRdlGenerator(this,"TableContent"); tableGen.Fields = m_selectedFields; reportItems.Tablix = new TablixType[] { tableGen.CreateTable() }; return reportItems.Create(); }
private void Parse(WordprocessingDocument doc, List <OpenXmlElement> childsNodes, ReportItems reportItems) { if (childsNodes == null || childsNodes.Count == 0) { return; } var blocks = GetParagraphs(childsNodes).Where(y => Regex.IsMatch(y.InnerText, @"<[\w-]+>")); foreach (var begBlock in blocks) { var endBlock = GetParagraphs(childsNodes).FirstOrDefault(y => Regex.IsMatch(y.InnerText, begBlock.InnerText.Replace("<", "</"))); if (endBlock == null || begBlock.Parent != endBlock.Parent) { continue; } var tmpBlock = GetNextElement(childsNodes, begBlock); var nodes = new List <OpenXmlElement>(); while (tmpBlock != endBlock && tmpBlock != null) { nodes.Add(tmpBlock); tmpBlock = GetNextElement(childsNodes, tmpBlock); } RemoveChildNodes(childsNodes, nodes); var blockName = begBlock.InnerText.Replace("<", "").Replace(">", ""); var reportBlock = reportItems.GetReportBlock(blockName); if (reportBlock != null) { foreach (var row in reportBlock.Rows) { var insertedNodes = InsertChildNodes(childsNodes, nodes, endBlock); Parse(doc, insertedNodes, row); } if (reportBlock.ShowFromNewPage && begBlock.Parent is Body) { var elem = begBlock.NextSibling(); if (elem is Paragraph && elem != endBlock) { elem.PrependChild(new Run(new Break { Type = BreakValues.Page })); } } } RemoveBegEndNodes(childsNodes, begBlock, endBlock); } var paragraphsWithMarks = GetParagraphs(childsNodes).Where(y => Regex.IsMatch(y.InnerText, @".*\[[\w-]+\].*")).ToList(); foreach (var paragraph in paragraphsWithMarks) { foreach (Match markMatch in Regex.Matches(paragraph.InnerText, @"\[[\w-]+\]", RegexOptions.Compiled)) { var paragraphMarkValue = markMatch.Value.Trim('[', ']'); var markValueFromCollection = reportItems.GetReportRecord(paragraphMarkValue)?.Value ?? ""; var rPr = paragraph.Descendants <Run>().FirstOrDefault()?.RunProperties?.CloneNode(true); var editedParagraphText = paragraph.InnerText.Replace(markMatch.Value, markValueFromCollection); paragraph.RemoveAllChildren <Run>(); var elems = editedParagraphText.Split("\n"); var list = new List <OpenXmlElement> { new Text(elems[0]) }; for (var i = 1; i < elems.Length; i++) { list.Add(new Break()); list.Add(new Text(elems[i])); } var r = new Run(list); if (rPr != null) { r.PrependChild(rPr); } paragraph.AppendChild(r); } } }
protected StatementGenerator(string name) { Name = name; _marks = new ReportItems(); }
/// <summary> /// Bind Report With DataSet /// </summary> /// <param name="ds">DataSet</param> public void DataBind(DataSet ds) { int count = 0; foreach (DataTable dt in ds.Tables) { count++; var report_name = "Report" + count; DataTable dt1 = new DataTable(report_name.ToString()); dt1 = ds.Tables[count - 1]; dt1.TableName = report_name.ToString(); } //Report Viewer, Builder and Engine ReportViewer1.Reset(); for (int i = 0; i < ds.Tables.Count; i++) { ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(ds.Tables[i].TableName, ds.Tables[i])); } ReportBuilder reportBuilder = new ReportBuilder(); reportBuilder.DataSource = ds; reportBuilder.Page = new ReportPage(); ReportSections reportFooter = new ReportSections(); ReportItems reportFooterItems = new ReportItems(); ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3]; //string footer = string.Format("Copyright {0} Report Generated On {1} Page {2}", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber); string footer = string.Format("Copyright {0} Report Generated On {1} Page {2} of {3} ", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber, ReportGlobalParameters.TotalPages); footerTxt[0] = new ReportTextBoxControl() { Name = "txtCopyright", ValueOrExpression = new string[] { footer } }; reportFooterItems.TextBoxControls = footerTxt; reportFooter.ReportControlItems = reportFooterItems; reportBuilder.Page.ReportFooter = reportFooter; ReportSections reportHeader = new ReportSections(); reportHeader.Size = new ReportScale(); reportHeader.Size.Height = 0.56849; ReportItems reportHeaderItems = new ReportItems(); ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1]; headerTxt[0] = new ReportTextBoxControl() { Name = "txtReportTitle", ValueOrExpression = new string[] { "Report Name: " + ReportTitle } }; reportHeaderItems.TextBoxControls = headerTxt; reportHeader.ReportControlItems = reportHeaderItems; reportBuilder.Page.ReportHeader = reportHeader; ReportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder)); ReportViewer1.LocalReport.DisplayName = ReportName; }
bool _PageBreakAtEnd; // Indicates the report should page break at the end of the rectangle. // constructor that doesn't process syntax public Rectangle(ReportDefn r, ReportLink p, XmlNode xNode, bool bNoLoop):base(r,p,xNode) { _ReportItems=null; _PageBreakAtStart=false; _PageBreakAtEnd=false; }
public Body() { this.ReportItems = new ReportItems(); }
/// <summary> /// Добавление контента, прописанного в базе конфигурации. /// </summary> protected void AddContentFromBase(UserRights userRights, Dictionary <string, UiObjSpec> uiObjSpecs, DataAccess dataAccess) { if (userRights != null && uiObjSpecs != null) { List <UiObjProps> uiObjPropsList = dataAccess.GetUiObjPropsList( UiObjProps.BaseUiTypes.Report | UiObjProps.BaseUiTypes.DataWnd); foreach (UiObjProps uiObjProps in uiObjPropsList) { int uiObjID = uiObjProps.UiObjID; if (!uiObjProps.Hidden && userRights.GetUiObjRights(uiObjID).ViewRight) { uiObjSpecs.TryGetValue(uiObjProps.TypeCode, out UiObjSpec uiObjSpec); if (uiObjProps.BaseUiType == UiObjProps.BaseUiTypes.Report) { // добавление элемента отчёта ReportItem reportItem = new ReportItem() { UiObjID = uiObjID, Text = uiObjProps.Title, Path = uiObjProps.Path }; if (uiObjSpec is ReportSpec reportSpec) { if (string.IsNullOrEmpty(reportItem.Text)) { reportItem.Text = reportSpec.Name; } reportItem.Url = uiObjSpec.GetUrl(uiObjID); reportItem.ReportSpec = reportSpec; } if (!string.IsNullOrEmpty(reportItem.Text)) { ReportItems.Add(reportItem); reportItemDict[uiObjID] = reportItem; } } else if (uiObjProps.BaseUiType == UiObjProps.BaseUiTypes.DataWnd) { // добавление элемента окна данных DataWndItem dataWndItem = new DataWndItem() { UiObjID = uiObjID, Text = uiObjProps.Title, Path = uiObjProps.Path }; if (uiObjSpec is DataWndSpec dataWndSpec) { if (string.IsNullOrEmpty(dataWndItem.Text)) { dataWndItem.Text = dataWndSpec.Name; } dataWndItem.Url = uiObjSpec.GetUrl(uiObjID); dataWndItem.DataWndSpec = dataWndSpec; } if (!string.IsNullOrEmpty(dataWndItem.Text)) { DataWndItems.Add(dataWndItem); dataWndItemDict[uiObjID] = dataWndItem; } } } } } }
private void Reload() { ReportItems.Clear(); LoadAllItems().AddToCollection(ReportItems); }