Microsoft PowerPoint is a program for preparing and viewing presentations. It is a part of Microsoft Office and is available in editions for Microsoft Windows and macOS operating systems, as well as for Android and iOS mobile platforms.
The program saves new presentations in * .pptx, * .ppt, * .ppsx and * .pps formats. From time to time the question arises - how to make a presentation in Delphi / Lazarus?
There are not so many options.
1. Learn about PPTX and write directly in this format. Honestly, it’s a dubious pleasure. But you will learn many interesting things. :)
2. Struggle with OLE, having MS Office installed on your working computer.
3. Or choose an alternative – for example, FastReport!
FastReport allows you to immediately see and check your document before exporting it to PowerPoint. There are so many options for changes, from barcodes (yes, those QR codes on slides that can send your audience to the website, give your business card, ask to vote etc.!) to charts and cards with pictures.
Let’s create a PowerPoint presentation from Delphi / Lazarus using FastReport designer
As usual, we will need only TfrxReport component on the form and a button with a handler.
Create a document of any kind, size and content, which will become our presentation!
Oh, and don’t forget to add TfrxPPRXExport on the form. Launch, check and save in PPTX format from the preview window.
Click on the Save icon in the upper left corner. Here we can see more than ten options for export to the required format.
In this case, we need to save in the Microsoft PowerPoint 2007 XML file format, so click on it.
Now, in the appeared window we can see the document export settings.
Here you can save all the pages, the current page or a range.
There is also the open after export function.
And the possibilities do not end there. In FastReport VCL you can save the file in the local storage, upload it to the cloud or send it by e-mail. Finally, click on the Save button.
We’ve covered how to write a report in the Microsoft PowerPoint 2007 XML file format from Delphi / C++Builder / Lazarus from the preview window.
Saving in the Microsoft PowerPoint 2007 XML file format from Delphi or Lazarus code
As you can see, it is easy to create presentations from Delphi or Lazarus. Of course, there are some limitations – graphics and maps from the presentation will become images and the beautiful effects such as “appear”, “dissolve” and the other objects behavior will need to be configured in the presentation making program.