Cloud Drive Overview

 

Background:

ReportBuilder includes support for the ability to automatically export and save reports to various cloud drive services. This is done via the REST APIs provided by the supported services. The cloud drive feature is designed with a plugin architecture allowing multiple services to be supported at once.

To register a certain plugin, simply add the unit to the uses clause of the application or use the TppCloudDrivePlugins class. (ppCloudDriveCustom.pas)

Each service is authorized using the OAuth 2.0 protocol. OAuth 2.0 allows access to a user’s account without the need for that user to provide the application any secure credentials (passwords). This is accomplished by logging into the desired service with the default secure web browser installed on the machine and obtaining temporary credentials to access the service. For more information on OAuth 2.0, please see the following article.

OAuth2 Overview

Services:

As mentioned in the OAuth 2.0 article above, each service requires the developer to register their application to access the API. Once an application is registered, a client ID, client password (secret), and redirect URL are given or created. These values need to be assigned to the proper settings in ReportBuilder in order to access the service. See the articles below for how to set up and connect to each supported service.

Cloud Drive Setup – Google Drive

Cloud Drive Setup – OneDrive

Cloud Drive Setup – Dropbox

Once the client credentials have been assigned, it is possible to export a report directly to a cloud drive from the Report Preview, Export Dialog, or via code.

ExportDlgCloud

 

 

 

 

 

 

 

 

 

 

From the export dialog, select the cloud service to be used and the cloud directory to save the exported file. If streaming has been disabled, a local file will be saved to the hard disk. Use the “Delete Local File” option to automatically remove this file once exporting is complete.

After the print button has been selected, a browser window will appear asking the user to log-in to their service account followed by a number of warnings ensuring the proper application is gaining access to their files. Once authorization is complete, the user is able to export files for approximately one hour before re-authorization is needed.

Note: Currently if the application is closed, re-authorization is also required.