{
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
index -= 1;
do
{
index += 1;
textPrintContents.Add(printObjects[index]);
}
while (index + 1 < printObjects.Count - 1 && printObjects[index + 1].ContentType == ContentTypes.Text);
ProjPrimitiveText primitiveText = new ProjPrimitiveText();
primitiveText.ConstructVisual(textPrintContents, printConfiguration, band, pageAvailWidth, pageAvailHeight);
}
break;
}}}
For exampe: hi
hello
have to print in same line like (hi hello)
the value of bool useSameLine will be passed in view level.
so what logic i can add in the above code to implement UseSameLine(setting this option) ? Please help.
I need the logic to append the value (printObjects[index]); value) in the below loop , Iam new to this please help.thanks in advance
do
{
index += 1;
textPrintContents.Add(printObjects[index]);
}
while (index + 1 < printObjects.Count - 1 && printObjects[index + 1].ContentType == ContentTypes.Text);
R JPosted Aug 14, 2014, 2:43 PM
You can use Stringbuilder if the property 'UseSameLine' true. Append each item to stringbuilder object.
Use "Foreach" to improve your code and try avoid do & while. No need of index if you use Foreach.