public override void MakeReport() { XmlDocument doc = Engine.db().makeReport(getSQL(null)); ReportViewForm rvf = new ReportViewForm(MenuText, FileName, new XmlDocument[] { doc }); rvf.ExcelEnabled = false; rvf.ShowDialog(); }
public override void MakeReport() { BuildTreeForm dlg = new BuildTreeForm(); if (dlg.ShowDialog() != DialogResult.OK) { return; } Filters f = new Filters("build", dlg.Build.ToString()); XmlDocument doc = Engine.db().makeReport(getSQL(f)); Dictionary <String, int> dict = new Dictionary <string, int>(); int total = 0; foreach (XmlNode nd in doc.FirstChild.ChildNodes) { nd.SelectSingleNode("address").InnerText = Building.FullPlaceName(nd.SelectSingleNode("address").InnerText); if (!dict.ContainsKey(nd.SelectSingleNode("dt").InnerText)) { dict.Add(nd.SelectSingleNode("dt").InnerText, 0); } dict[nd.SelectSingleNode("dt").InnerText]++; total++; } XmlElement newND, tmp; foreach (KeyValuePair <string, int> kvp in dict) { newND = doc.CreateElement("Row"); tmp = doc.CreateElement("name"); tmp.InnerText = "итого"; newND.AppendChild(tmp); tmp = doc.CreateElement("dt"); tmp.InnerText = kvp.Key; newND.AppendChild(tmp); tmp = doc.CreateElement("address"); tmp.InnerText = total.ToString(); newND.AppendChild(tmp); tmp = doc.CreateElement("plus"); tmp.InnerText = kvp.Value.ToString(); newND.AppendChild(tmp); doc.FirstChild.AppendChild(newND); } ReportViewForm rvf = new ReportViewForm(MenuText, FileName, new XmlDocument[] { doc }); rvf.ExcelEnabled = false; rvf.ShowDialog(); }
private void svidMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count != 1) { return; } XmlDocument[] docs = ReportHelperExt.GetRabbitPlem((listView1.SelectedItems[0].Tag as AdultRabbit).ID); ReportViewForm rf = new ReportViewForm(myReportType.RABBIT, docs); rf.ShowDialog(); if (rf.IsPrinted) { int num = Engine.opt().getIntOption(Options.OPT_ID.NEXT_SVID); Engine.opt().setOption(Options.OPT_ID.NEXT_SVID, num + 1); } }