Formatting a full data struture is done with an output archive (called oarchive.)
dynamic::var data; // Insert some values into data std::ostringstream result; json::oarchive archive(result) archive << data;