Creating Reports from QuickBooks or Salesforce Data Sources Using ReportingCloud and CData Cloud Drivers
This article describes the functionality of Text Control ReportingCloud - the Web API powered reporting platform to create MS Word compatible reports in the cloud. This product is not available yet and is going to be released soon. Bjoern Meyer While preparing the launch of our next product ReportingCloud, we are testing the Web API and building sample applications. ReportingCloud is a smart way to bring your desktop or server application to the web or mobile market. With an easy-to-use,…

This article describes the functionality of Text Control ReportingCloud - the Web API powered reporting platform to create MS Word compatible reports in the cloud. This product is not available yet and is going to be released soon.
Bjoern Meyer
While preparing the launch of our next product ReportingCloud, we are testing the Web API and building sample applications. ReportingCloud is a smart way to bring your desktop or server application to the web or mobile market. With an easy-to-use, highly available Web API, you can create documents from any client including web, mobile and desktop applications.
Consider the following scenario: Your customer is using a local desktop version of QuickBooks which is installed on an in-house server or desktop. But their users want to create invoices or quotes using a web interface or mobile app on their iOS or Android smart phones.
The Cloud Drivers from CData Software make on-premise data sources accessible across platforms and devices. The data is returned as JSON and can be directly used to merge MS Word compatible templates using ReportingCloud.

After installing the CData Cloud Driver for QuickBooks, you can connect the driver to your QuickBooks Desktop or Online account and specify the data tables you would like to access using the cloud driver:

The CData Cloud Driver runs on your desktop or server and is now accessible from outside using HTTP methods. The following GET method returns all data rows from the table Customers:
GET https://localhost:8032/api.rsc/Customers
Creating the Template Using ReportingCloud
The above GET method returns a JSON string (simplified in this sample):
{
"@odata.context": "http://localhost:8047/api.rsc/$metadata#dbo.Customer",
"value": [
{
"name": "Petersen",
"firstname": "Klaus",
"id": 1
},
{
"name": "Hans",
"firstname": "Hansen",
"id": 2
}
]
}
The data we are interested in is in the value property of the JSON object. In order to create a template, we can copy the data of the value property and paste it into the New Datasource Excerpt File box in the portal of ReportingCloud:

A datasource excerpt file is used to fill the drop-down lists of the template editor with proper merge fields, relations and dummy data for a template preview. A datasource excerpt file is not your actual data that is used to merge your template. It helps you to design your templates and to insert the proper field names.
The format of the datasource excerpt file is the same as the accepted datasource of the Merge Web API method. It is a JSON string containing an array of objects.

The following sample code shows how to call the CData Cloud Driver Web API to get all records from the table Customer. This data is then posted to the ReportingCloud Web API to merge the template with live data from the local QuickBooks database:
using (HttpClient client = CreateHttpClient())
{
// set the endpoint
HttpResponseMessage response = client.GetAsync("api.rsc/Customer").Result;
// return an ActionSettings object, if sucessful
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
List<Customer> customers =
JObject.Parse(result)["value"].ToObject<List<Customer>>();
Report report = new Report()
{
Customers = customers
};
ReportingCloud rc = new ReportingCloud(
"username",
"password",
new Uri("https://api.reporting.cloud"));
MergeBody mergeBody = new MergeBody() {
MergeData = report
};
List<string> results = rc.MergeDocument(
mergeBody, "CloudDriver_Sample.tx");
File.WriteAllBytes("results.pdf", Convert.FromBase64String(results[0]));
}
else
{
// throw exception with the message from the endpoint
throw new ArgumentException(response.Content.ReadAsStringAsync().Result);
}
}
The Merge method of ReportingCloud returns a list of PDF documents encoded as Base64 strings. The resulting sample document with data from the QuickBooks Customer table is shown below:

Instead of consuming the plain Web API, we built language specific wrappers. They encapsulate all HTTP requests and provide classes to manage templates and to merge documents. In this sample, the ReportingCloud .NET wrapper is used. We also provide wrappers for Java, PHP and Ruby for an easy integration into your applications.
Stay tuned for more details.
Cloud
Are we moving to the cloud? This question is changing from "if" to "when" and "how". Text Control ReportingCloud brings complete reporting functionality to the cloud so all developers can use it, irrespective of the platform or language they're using. Its highly RESTful API can be used to merge Microsoft Word compatible templates with JSON data from all clients including .NET, Javascript, PHP, Node.JS, jQuery, Ruby, Python, Android, Java and iOS.
Related Posts
ReportingCloud: Uploading Templates Vs. Sending Templates Inside MergeBody
Our reporting Web API ReportingCloud provides two different ways to upload templates for merging processes: Upload templates into the template storage in a separate step Upload templates inside…
MailMerge: Table Headers and Repeating Blocks
When using table headers and repeating blocks in combination in a MailMerge process, there are some things you need to know before creating your templates. A table header can consist of n number…
ReportingCloud: Conditional Text Blocks Based on Merge Blocks
In several applications, it is required to render or to remove a complete text block in a template based on specific conditions. The following screenshot shows a template with a merge block…
Web API Test Sandbox Released on ReportingCloud Portal
We just released a Web API Test Sandbox at the ReportingCloud portal. This sandbox can be used to test Web API calls with your account data and your template storage (so not a completely isolated…
ReportingCloud: New Test Parameter for Document Quota Related Endpoints
The quota related endpoints merge, convert and findandreplace received the new, optional parameter test to send test calls that doesn't count against the document quota. This parameter allows you…