std::wstring CompactorReport::getReport() const
{
    std::wstringstream report;
    report << L"Model Compaction Report\n"
           << L"=======================\n\n";
    if (! mErrorMessage.empty()) report << L"Error message: " << mErrorMessage << L"\n\n";
    std::wstring indent = L"";
    if (mVariableForCompaction.size() > 0)
    {
        report << L"Some variables have not been compacted.\n"
               << L"Uncompacted variables are given below.\n\n";
        for (size_t i=0; i<mVariableForCompaction.size(); ++i)
        {
            ObjRef<iface::cellml_api::CellMLVariable> variable = mVariableForCompaction[i].first;
            ObjRef<iface::cellml_api::CellMLVariable> srcVariable = mVariableForCompaction[i].second;
            std::wstring modelUri = variable->modelElement()->base_uri()->asText();
            std::wstring srcModelUri = srcVariable->modelElement()->base_uri()->asText();
            for (size_t j=0;j<i;++j) indent += L"\t";
            report << indent << L"Compaction requested for variable: " << modelUri << L" # "
                   << variable->componentName() << L" / "
                   << variable->name() << L";\n" << indent << L"with the actual source variable being: "
                   << srcModelUri << L" # " << srcVariable->componentName() << L" / " << srcVariable->name() << L"\n";
        }
    }
    report.flush();
    return report.str();
}