We just need reverse of this i.e to generate flat file similar to this from db with the sp which returns multiple results(header record-set,footer record-set,rows record set). each having different columns and widths.
If you can give us example that will be really helpful.