When I try and merge/clone multiple ASPPS files genereated from Microsoft Reporting Serverices using Aspose.Slides for Reporting Services the output gets all messed up. I use Aspose Slides for .net to merged the outputs.
I know the reports that are genereated from Reporting Services are OK because I can export them individually which I have included in this thread.
I have attached 3 samples that where created. 2 of them where just using reporting services the other was merged using aspose slides for .net after reporting services created them.
DMTest1.ppt - Created using Aspose Slides for Reporting Services
DMTest2.ppt - Created using Aspose Slides for Reporting Services
DMTest3Merged.ppt - Created using Aspose Slides for Reporting Services and then merged the 2 reports using Aspose Slides for .net.
Below is the code I use to merge the Power point presentations.
public static byte[] MergePPT(IList lstBytes)
{
if (lstBytes == null)
throw new ArgumentNullException("MergePPT: lstBytes is null");
if (lstBytes.Count == 0)
return null;
if (lstBytes.Count == 1)
return lstBytes[0];
Presentation newPPT = new Presentation();
foreach(byte[] pptStream in lstBytes)
{
Presentation pres = new Presentation(new MemoryStream(pptStream));
foreach (Slide pptSlide in pres.Slides)
newPPT.CloneSlide(pptSlide, newPPT.Slides.LastSlidePosition + 1);
}
newPPT.Slides.RemoveAt(0); //This removes the empty slide that is created when you crete the Presentation object
MemoryStream ms = new MemoryStream();
newPPT.Save(ms, Aspose.Slides.Export.SaveFormat.Ppt);
return ms.ToArray();
}