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.
https://rbwiki.digital-metaphors.com/output/cloud-drive/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.
https://rbwiki.digital-metaphors.com/output/cloud-drive/cloud-drive-setup-google-drive/
https://rbwiki.digital-metaphors.com/output/cloud-drive/cloud-drive-setup-onedrive/
https://rbwiki.digital-metaphors.com/output/cloud-drive/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.
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 using ReportBuilder as needed.
Note: ReportBuilder 22 includes support for Refresh Tokens which removes the need to re-authorize each time the application is closed. Earlier versions of ReportBuilder still require re-authorization.