How to create a file in the Microsoft PowerPoint 2007 XML format from Delphi/C++Builder/Lazarus

2020-07-27

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.

The opening of the preview window
1
2
3
4
5
6
7
procedure TForm1.Button1Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 if frxReport1.PrepareReport then
 frxReport1.ShowPreparedReport; 
 {and show preview window}
end;

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.

Save to Microsoft PowerPoint 2007 XML

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. 

Setting Microsoft PowerPoint 2007 XML

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.

Setting Microsoft PowerPoint 2007 XML

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

Saving to Microsoft PowerPoint 2007 XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
procedure TForm1.Button1Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxPPTXExport1.PageNumbers := '2-3';
 {Set in what format to export your images}
 //uses frxImageConverter;
 // TfrxPictureType = (gpPNG, gpBMP, gpJPG {$IFNDEF FPC}, gpGIF, gpEMF, gpWMF{$ENDIF})
 frxPPTXExport1.PictureType := gpPNG;
 {Set whether to open the resulting file after export}
 frxPPTXExport1.OpenAfterExport := False;
 {Set whether to display export progress
  (show which page is currently being exported)}
 frxPPTXExport1.ShowProgress := False;
 {Set whether to display the export filter settings dialog box}
 frxPPTXExport1.ShowDialog := False;
 {Set the name of the resulting file.} 
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxPPTXExport1.FileName := 'C:\Output\test.pptx';
 {Export the report}
 frxReport1.Export(frxPPTXExport1);
end;

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. 

November 20, 2024

Localization and Language Switching in FastReport VCL

FastReport VCL supports 40 languages for interface localization and allows you to change the language on the fly through menus or code, without recompilation.
November 01, 2024

New Features of the FastReport VCL Editor

We are considering new features of the report editor: extension lines, highlighting of intersecting objects, updated report and data trees.
October 30, 2024

Using Styles When Creating Reports in FastReport VCL

The article discusses one of the new features of FastReport VCL — the use of styles and style sheets.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.