Hi Rachana,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks you for the details.
Please see the updated question
below. Will appreciate a response asap.
1: The first page has
some hi-res images e.g. some different geometric shapes with text in it. The
location of the image(16 images in total ) on the page will be static, however
the fill color of image can be either green or grey.E.g. one box can be green
for one user , for other it can be grey etc.
see the following documentation link with details regarding how to work with
shapes and pictures using Aspose.Slides for .NET.
2: the second page of
the report will be data from a DB and will formatted as a content tree
I am not sure regarding your above
requirement. Please share some sample presentation file (creating manually) to
show the required feature.
I am planning to create
a template with the images or shapes, pre existing , with superimposed images,
e.g. green filled image and grey filled image superimposed on each other
.Depending on the selection made by the user at runtime, I want to "Send to
Back" or "Bring to Front." Can I change the "Send to
Back" or "Bring to Front" properties at runtime depending on
parameters passed to the report?
IShapeCollection class exposes Reorder() method to set the order of
shapes in a slide. Please see the
following sample code for your reference:
class that represents the PPTX
using (Presentation pres = new
//Get the first slide
ISlide sld = pres.Slides;
//Add autoshapes of rectangle type
IAutoShape shp =
50, 150, 150, 50);
IAutoShape shp2 =
70, 170, 170, 70);
//Get all shapes in a slide
IShapeCollection collection =
//Set order -- in the below case Shape2 will
be on top of shape one
//Change the first parameter "index"
to 0 and Shape2 will be at bottom.
//Write the PPTX file to disk
Also, I need to make
sure that the template approach will not lead to issues when multiple user try
to generate the report.
Well, it depends on how you are handling the user’s interaction
in your application. In case you have any specific concern regarding this,
please share and we will be happy to assist you accordingly.
Also, I want the image
path to be configurable, so that when business wants to change the text or
color of the image, I do not need to redeploy the code. I can just change the
Well, I am afraid, this is not
possible as Pictures / images are embedded in the presentation file and are not
linked with the source. However, in your application you can implement the logic
to update an image in your presentation file. Please see the following sample
code for reference.
Presentation pres = new Presentation(path
for (int i = 0; i < pres.Slides.Count; i++)
sl = pres.Slides[i];
j = 0; j < sl.Shapes.Count; j++)
the shape with picture
sh = sl.Shapes[j];
fill type of the shape
fillType = sh.FillFormat.FillType;
//If the fill
type of shape is picture
(fillType == FillType.Picture)
System.Drawing.Image img = (System.Drawing.Image)new Bitmap(path + "logo.jpg");
imgx = pres.Images.AddImage(img);
sh.FillFormat.PictureFillFormat.Picture.Image = imgx;
pres.Write(path + "ChangedPic.ppt");
Please feel free to contact support
in case you need any further assistance.
Thanks & Regards,