// Create single text private void FillTextSingle() { int rank = 1; TeamPrint.CheckIfEqualSingle(singlePrintList); txbSingle.Text += cname + ", " + cdate.ToShortDateString() + "\n\n"; txbSingle.Text += String.Format("{0,10}{1,25}{2,30}{3,15}{4,15}{5,15}\n\n", "MESTO", "IME IN PRIIMEK", "STRELI", "ŠT.STRELOV", "ODBITEK", "REZULTAT"); foreach (singleprintview spv in singlePrintList) { //txbSingle.Text += rank.ToString() + ". " + spv.name + " " + spv.surname + " (" + spv.score.ToString() + ")\n"; txbSingle.Text += String.Format("{0,10}{1,25}{2,30}{3,15}{4,15}{5,15}\n\n", rank + ".", spv.name + " " + spv.surname, string.Join(":", spv.hits.Split(':').Reverse().ToArray()), spv.shots, spv.penal, spv.score); rank++; } }
//CODE FOR CREATING FIXED DOCUMENT SINGLE private void FillTextSingle() { int rank = 1; int blocks_on_page = 34; int counter = 34; FixedPage page = null; TextBlock pageText = null; PageContent pageContent = null; TeamPrint.CheckIfEqualSingle(singlePrintList); foreach (singleprintview spv in singlePrintList) { if (counter % blocks_on_page == 0) { page = new FixedPage(); pageText = new TextBlock(); pageContent = new PageContent(); pageText.FontFamily = new FontFamily("Consolas"); pageText.Text = String.Format("\n {0}, {1}{2,70}. stran\n\n", cname, cdate.ToShortDateString(), counter / blocks_on_page); pageText.Text += String.Format("{0,10}{1,25}{2,30}{3,15}{4,15}\n\n", "MESTO", "IME IN PRIIMEK", "STRELI", "ŠT.STRELOV", "REZULTAT"); } pageText.Text += String.Format("{0,10}{1,25}{2,30}{3,15}{4,15}\n\n", rank + ".", spv.name + " " + spv.surname, string.Join(":", spv.hits.Split(':').Reverse().ToArray()), spv.shots, spv.score); if (counter % blocks_on_page == 0) { page.Children.Add(pageText); ((IAddChild)pageContent).AddChild(page); fixed_doc_single.Pages.Add(pageContent); } rank++; counter++; } }