public string GetPrintDecorationText(PrintDecoration printDecoration) { string firstString = "[---]"; string fieldName = printDecoration == PrintDecoration.HEADER ? "header" : "footer"; try { string HeaderContent = HeaderFooterDataset().Tables["PrintStyle"].Select("style_name = 'normal'")[0][fieldName].ToString(); StringTokenizer tempStringTokenizer = new StringTokenizer(HeaderContent, "\r\n"); firstString = tempStringTokenizer.NextToken(); while (tempStringTokenizer.HasMoreTokens()) { firstString += "\r\n" + tempStringTokenizer.NextToken(); } } catch (Exception esx) { } return firstString; }
public string GetPrintDecorationText(PrintDecoration printDecoration) { string firstString = "[---]"; string fieldName = printDecoration == PrintDecoration.HEADER ? "header" : "footer"; try { string HeaderContent = HeaderFooterDataset().Tables["PrintStyle"].Select("style_name = 'normal'")[0][fieldName].ToString(); StringTokenizer tempStringTokenizer = new StringTokenizer(HeaderContent, "\r\n"); firstString = tempStringTokenizer.NextToken(); while (tempStringTokenizer.HasMoreTokens()) { firstString += "\r\n" + tempStringTokenizer.NextToken(); } } catch (Exception esx) { } string[] lines = null; char[] param = { '\n' }; if (firstString != null && firstString.Length > 0) { lines = firstString.Split(param); } int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) { foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } } TotalHader += "\r\n\r\n\r\n\r\n"; return(TotalHader); }
public string GetPrintDecorationText(PrintDecoration printDecoration) { string firstString = "[---]"; string fieldName = printDecoration == PrintDecoration.HEADER ? "header" : "footer"; try { string HeaderContent = HeaderFooterDataset().Tables["PrintStyle"].Select("style_name = 'normal'")[0][fieldName].ToString(); StringTokenizer tempStringTokenizer = new StringTokenizer(HeaderContent, "\r\n"); firstString = tempStringTokenizer.NextToken(); while (tempStringTokenizer.HasMoreTokens()) { firstString += "\r\n" + tempStringTokenizer.NextToken(); } } catch (Exception esx) { } string[] lines = null; char[] param = { '\n' }; if (firstString != null && firstString.Length > 0) lines = firstString.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } TotalHader += "\r\n\r\n\r\n\r\n"; return TotalHader; }