Standard Residential Lease Agreement [SAMPLE].docx
Microsoft Word
{
"ConnectionString": "https://fluent-sample-templates.s3.amazonaws.com/Standard+Residential+Lease+Agreement+%5BSAMPLE%5D.docx",
"OutputFormat": "pdf",
"Format": "docx",
"Parameters": [
{
"Name": "UnitName",
"WrappedValue": {
"ParamType": "text",
"RawValue": "Hillcrest - 1"
}
},
{
"Name": "YourName",
"WrappedValue": {
"ParamType": "text",
"RawValue": "{Your Name Here}"
}
},
],
"Datasources": [
{
"Name": "LeaseTracker_Units",
"Type": "json",
"ConnectionString": "https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerUnits.json",
},
{
"Name": "LeaseTracker_Tenants",
"Type": "json",
"ConnectionString": "https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerTenants.json",
},
{
"Name": "LeaseTracker_Buildings",
"Type": "json",
"ConnectionString": "https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerBuildings.json",
}
]
}
import net.windward.datasource.DataSourceProvider;
import net.windward.datasource.xml.SaxonDataSource;
import net.windward.xmlreport.ProcessPdf;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class JavaSample {
public static void main(String[] args) {
try {
// Download the sample file to your computer and place the path to the file here.
FileInputStream template = new FileInputStream("Standard+Residential+Lease+Agreement+[SAMPLE].docx");
// The output file
File fileReport = new File("report.pdf");
FileOutputStream reportStream = new FileOutputStream(fileReport);
ProcessPdf report = new ProcessPdf(template, reportStream);
// Preparation...
report.processSetup();
// Set the report Input Parameters
Map<String, Object> mapVariables = new HashMap<String, Object>();
// Replace the specified values with the values you want each time you run the report.
mapVariables.put("UnitName", "Hillcrest - 1");
mapVariables.put("YourName", "{Your Name Here}");
myReport.setParameters(mapVariables);
// Set up the datasources
Map<String, DataSourceProvider> dataSources = new HashMap<String, DataSourceProvider>();
DataSourceProvider LeaseTracker_Units = new JsonDataSource("Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerUnits.json;", JsonDataSource.MODE_CONNECTION_STRING);
DataSourceProvider LeaseTracker_Tenants = new JsonDataSource("Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerTenants.json;", JsonDataSource.MODE_CONNECTION_STRING);
DataSourceProvider LeaseTracker_Buildings = new JsonDataSource("Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerBuildings.json;", JsonDataSource.MODE_CONNECTION_STRING);
// Add the datasources to the report
dataSources.put("LeaseTracker_Units", LeaseTracker_Units);
dataSources.put("LeaseTracker_Tenants", LeaseTracker_Tenants);
dataSources.put("LeaseTracker_Buildings", LeaseTracker_Buildings);
// Insert all data into the report.
myReport.processData(dataSources);
// And... DONE!
report.processComplete();
template.close();
reportStream.close();
} catch (Exception e) {
// Uh oh, just in case
e.printStackTrace();
}
}
}
using System.IO;
using net.windward.api.csharp;
using WindwardInterfaces.net.windward.api.csharp;
namespace DotNetSample
{
class DotNetSample
{
static void Main(string[] args)
{
// Initializing the engine
Report.Init();
// Download the sample file to your computer and place the path to the file here.
FileStream template = File.OpenRead("Standard+Residential+Lease+Agreement+[SAMPLE].docx");
FileStream output = File.Create("Report.pdf");
// Create report process
Report myReport = new ReportPdf(template, output);
myReport.ProcessSetup();
// Set the report Input Parameters
Dictionary<string, object> mapVariables = new Dictionary<string, object>();
// Replace the specified values with the values you want each time you run the report.
mapVariables.Add("UnitName", "Hillcrest - 1");
mapVariables.Add("YourName", "{Your Name Here}");
myReport.Parameters = mapVariables;
// Set up the datasources
IDictionary<string, IReportDataSource> dataSources = new Dictionary<string, IReportDataSource>();
IReportDataSource LeaseTracker_Units = new JsonDataSourceImpl(@"Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerUnits.json;", JsonDataSourceImpl.MODE.CONNECTION_STRING);
IReportDataSource LeaseTracker_Tenants = new JsonDataSourceImpl(@"Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerTenants.json;", JsonDataSourceImpl.MODE.CONNECTION_STRING);
IReportDataSource LeaseTracker_Buildings = new JsonDataSourceImpl(@"Encoding=utf-8;Url=https://fluent-sample-templates.s3.amazonaws.com/AirTableLeaseTrackerBuildings.json;", JsonDataSourceImpl.MODE.CONNECTION_STRING);
// Add the datasources to the report
dataSources.Add("LeaseTracker_Units", LeaseTracker_Units);
dataSources.Add("LeaseTracker_Tenants", LeaseTracker_Tenants);
dataSources.Add("LeaseTracker_Buildings", LeaseTracker_Buildings);
// Run the report process
myReport.ProcessData(dataSources);
myReport.ProcessComplete();
// Close out of our template file and output
data.Close();
output.Close();
template.Close();
}
}
}