public bool UseSameLine
{
get { return useSameLine; }
set { useSameLine = value; }
}
if (printObjects != null && printObjects.Count > 0)
{
List
for (int index = 0; index < printObjects.Count; index++)
{
switch (printObjects[index].ContentType)
{
case ContentTypes.Text:
{
List
StringBuilder sameLine = new StringBuilder();//
index -= 1;
do
{
index += 1;
//textPrintContents.Add(printObjects[index]);
if (printObjects[index].UseSameLine)
sameLine.Append(printObjects[index]);
} while (index + 1 < printObjects.Count - 1 && printObjects[index + 1].ContentType == ContentTypes.Text);
ProjPrintContent cnt = new ProjPrintContent();
cnt.Content = sameLine;
textPrintContents.Add(cnt);
ProjPrimitiveText primitiveText = new ProjPrimitiveText();
primitiveText.ConstructVisual(textPrintContents, printConfiguration, band, pageAvailWidth, pageAvailHeight);
}
In the above code "contentType.Text" i have to print the datas in the same line.
For exampe: hi
hello
have to print in same line like (hi hello)
the value of bool useSameLine will be passed in view level.
do
{
index += 1;
textPrintContents.Add(printObjects[index]);
}
while (index + 1 < printObjects.Count - 1 && printObjects[index + 1].ContentType == ContentTypes.Text); I have added the highlighted code in the above code.
But data is not displaying.
I think problem is in ProjPrintContent cnt = new ProjPrintContent();
cnt.Content = sameLine;
textPrintContents.Add(cnt);
If i add //textPrintContents.Add(printObjects[index]); line alone instead of highlighted lines.Data is displaying but in sameline.
But i need to display in sameline. and i need space between each line eg: Hi Hello..
PLs help.
R JPosted Aug 19, 2014, 12:30 PM
cnt.Content = sameLine.ToString();
Can you try this?