We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bullet points with text from database

Have a PPTX slite template with various pages. Some pages have shapes with bullet points. I read text fields from a db-field (entered by customers, e.g. do not know what text they enter) and want to show the different db-answers as individual bullet points. Problem: If I simply replace the template shape field with a string containing all db-texts then the line break in the text will add a bullet point. Which is the right way of adding bullet points to shapes / how do handle the line breaks int the individual db-field texts?

Hi Bo Ander,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I would recommend you to please use soft enter
("\v") for the user data instead of
carriage return or line break. By doing so all the user data will get
accommodated in one paragraph but in multiple lines. For your kind reference,
the example code is shared.<o:p></o:p>

//Instantiate
a Presentation object that represents a PPT file<o:p></o:p>

Presentation
pres = new Presentation();<o:p></o:p>

//Accessing
a slide using its slide position<o:p></o:p>

Slide
slide = pres.AddBodySlide ();//.GetSlideByPosition(1);<o:p></o:p>

//Accessing
the first placeholder in the slide and typecasting it as a text holder<o:p></o:p>

TextHolder
th = (TextHolder)slide.Placeholders[1];<o:p></o:p>

//Getting
the first paragraph of the text holder<o:p></o:p>

Paragraph
para = th.Paragraphs[0];<o:p></o:p>

//True
means, it has bullets<o:p></o:p>

para.HasBullet = true;<o:p></o:p>

//Setting
the bullets color<o:p></o:p>

para.BulletColor = Color.Blue;<o:p></o:p>

//Setting
the bullet height<o:p></o:p>

para.BulletHeight = 125;<o:p></o:p>

//Setting
the bullet character using the ASCII code of a symbol<o:p></o:p>

para.BulletCharacter = Convert.ToChar("?");<o:p></o:p>

para.Text = “Hi Mudassir \v how are your there”;<o:p></o:p>

//Writing
the presentation as a PPT file<o:p></o:p>

pres.Write(“D:\modified.ppt”);<o:p></o:p>

Thanks and Regards,