Customer Login Forum Online Help Open Source Deutsche Version

Report Engine and PDF Library: Example code in C/C++ (DLL/.so)

This example program is using the VPE Report Engine DLL.

With the function VpeOpenDoc() a new document is created and a handle for the document is returned. This handle is used in the following code, to access the document.

The function VpePicture inserts an image, four coordinates are supplied: (left, top, right, bottom). The parameter "VFREE" instructs VPE to compute the given coordinate for a text or image itself.

With VpeWriteDoc the document is written by the integrated PDF Library as PDF file, and finally the call to the function VpePreviewDoc shows the preview window.

void CreateDocument()
{
VpeHandle hReport;
hReport = VpeOpenDoc(hWndParent, "Tutorial", 0);
VpePrint(hReport, 1.5, 1, "Hello World!");
VpePicture(hReport, 1.5, 2, VFREE, VFREE, "example.jpg");
VpeWriteDoc(hReport, "My Document.pdf");
VpePreviewDoc(hReport, NULL, VPE_SHOW_NORMAL);
}

bullet Customer's Responses

"I have been constantly fighting with the limitations of Seagate Crystal Reports to get the reports that I want. Now, with VPE, I'm glad to have found a reporting tool that offers all the freedom I need. I have not yet come across a problem that VPE couldn't handle! Thanks for your help!"

Mark Irwin, Developer, Canada Life Assurance Company, Regina, Saskatchewan, Canada

More...