To view or save your positions into CSV format, first open your Account Window by clicking the Account menu option in TWS followed by Account Window.
From there, click the File menu option followed by Export Portfolio, Enter a name for your file and, once finished, click Save.
This will work in both a live and paper trading account.