ReportingCloud: New Endpoint to Find and Replace Text
The ReportingCloud /v1/document/findandreplace endpoint searches and replaces text across all document parts including headers, footers, and text frames. The POST method accepts an array of string pairs for batch find-and-replace, useful for legacy templates without merge fields.

We just released a new endpoint to the ReportingCloud Web API:
https://api.reporting.cloud/v1/document/findandreplace
This new endpoint can be used to find any text in any text part of a document including the main text, headers and footers and text frames. The endpoint POST method accepts an array of string arrays with pair values to find and replace strings in a template.
The following code, that uses the ReportingCloud .NET wrapper, finds and replaces the string Invoice with ReplacedText and Invoice2 with ReplacedText2 in the complete document.
ReportingCloud rc = new ReportingCloud("username", "password");
FindAndReplaceBody body = new FindAndReplaceBody();
body.FindAndReplaceData = new List<string[]> {
new string[] { "Invoice", "ReplacedText" },
new string[] { "Invoice2", "ReplacedText2" }
};
byte[] bDocument = rc.FindAndReplaceDocument(body, "invoice.tx", ReturnFormat.HTML);
string sHtmlDocument = System.Text.Encoding.UTF8.GetString(bDocument);
Console.WriteLine(sHtmlDocument.Contains("ReplacedText"));
For mail merge purposes, usually merge fields are used and those templates are merged using the endpoint document/merge. But in several scenarios or templates from legacy applications, simple find and replace processes are very useful.
Start today with ReportingCloud and sign up for a free trial account.
Happy coding!
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 Monthly Payment Available
ReportingCloud now supports monthly subscription plans that auto-renew each billing cycle until cancelled. Subscribers manage active plans and view payment invoices through the online store…
ReportingCloud: Setting the Culture for Date and Currency Fields
ReportingCloud adds a culture property to the MergeSettings object in the document/merge endpoint. Passing a Language Culture Name such as de-DE or en-US controls how currency symbols, decimal…
Visit Text Control at BASTA! 2017
Text Control exhibits at BASTA! 2017 in Mainz, showcasing the TX Text Control X15 beta with thesaurus, mini toolbar, chart ribbon tab, and background image features. The booth also demonstrates…
More Impressions from DWX Developer Week 2017
Text Control concluded its exhibition at DWX Developer Week 2017 by holding an Xbox One raffle on the final day. The team continued demonstrating reporting products at their Nuremberg booth,…
DWX Developer Week 2017: First Impressions
Text Control exhibited at DWX Developer Week 2017 in Nuremberg, one of Germany's largest developer conferences. The team showcased .NET reporting libraries at their booth, previewed the TX Text…
