This business case has been conceived for the demonstration purpose and serves well for a typical shopping store. There may be simpler or complex scenarios in real life businesses.
The examples of this documentation report on Harbor Lane Provisions, a specialty-food wholesaler at 18 Quayside Road, Port Ellery. It sells coffee, cheese, oil, honey and biscuits to restaurants and cafés: Quayside Bistro, Lantern Street Café, Saltmarsh Deli and Pier Nine Kitchen.
Business Case
There are many customers of the shopping store.
The store offers multiple products.
A customer may place multiple orders.
An order may have many products.
The data may or may not be stored in a database system.
Reporting Requirements
A report based on some criteria is to be generated.
The report can be in any of the formats: Documents, Spreadsheets, Presentations, emails, HTML and text.
The report developer must be able to define templates and then generate reports.
Business Objects
Python Data
The .NET examples declare Customer, Order, Product and Service classes. In Python, the same objects are dicts and lists: a dict’s keys are the members a template reads, and a list is a sequence a template iterates. One customer of the shop looks as follows (one of its three orders shown):
A template reads it as it reads the C# objects: <<[customer.CustomerName]>>, <<foreach [o in customer.Order]>><<[o.Product.ProductName]>><</foreach>>. The order dates are strings in JSON; the examples whose templates read a date turn them into datetime objects while loading the file. The Business Layer describes every data file and how the examples load it.
Database Entities
The .NET examples also read the customers, orders and products from an SQL database. A Python application reads such rows with its database driver and passes them as dicts, one per row, as shown in The Business Layer.
Templates Location
Each example reads its template from the folder it runs in, by the template’s file name. The tabs beside each example link the template and the data files it reads, so you can download them into one folder and run the example there. In your own application, keep the templates wherever suits you, and organize them in sub-folders as you see fit.
Reports Location
Each example writes its report into the folder it runs in, under a name derived from the template’s (in-table-list-report.docx for in-table-list.docx). In your own application, pass any path, or a stream, as the report.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.