Forums

Django Report Builder - invalid literal for int() with base 10: ''

I am trying to use Django-Report Builder to create reports. But after creating the reports when I click on XLSX or CSV it gives me this error

Request Method: GET
Request URL:    https://something.pythonanywhere.com/report_builder/api/report/1/download_file/xlsx/
Django Version: 2.2.7
Exception Type: ValueError
Exception Value:    
invalid literal for int() with base 10: ''
Exception Location: /home/something/.virtualenvs/quizdemo/lib/python3.8/site-packages/django/db/models/fields/__init__.py in get_prep_value, line 972
Python Executable:  /usr/local/bin/uwsgi
Python Version: 3.8.0
Python Path:    
['/var/www',
 '.',
 '',
 '/var/www',
 '/home/hrtest/.virtualenvs/quizdemo/lib/python38.zip',
 '/home/hrtest/.virtualenvs/quizdemo/lib/python3.8',
 '/home/hrtest/.virtualenvs/quizdemo/lib/python3.8/lib-dynload',
 '/usr/lib/python3.8',
 '/home/hrtest/.virtualenvs/quizdemo/lib/python3.8/site-packages',
 '/home/hrtest/quizdemo']
Server time:    Tue, 20 Oct 2020 11:49:17 +0000

This works perfectly in my local host. I am not sure what is missing. When I click on Preview I get javascript error:

polyfills-es2015.js:1 GET https://something.pythonanywhere.com/report_builder/api/report/1/generate/ 500 
(Internal Server Error)

This seems to be specific problem to pythonanywhere. How could I get more details for this issue ? Any help from users who have used Report Builder

According to your error logs (which you can find linked in the "Log Files" section of your Web page) it seems that the error occurs during a database lookup which returns an empty string when an integer is required. I'd suggest you should check your report builder configuration or database setup for the given field.

Could you please elaborate the answer. I am unable to find which field. Report builder works as expected in local server.

Could you show the full traceback?