smartsheet-platform / smartsheet-python-sdk

Library that uses Python to connect to Smartsheet services (using API 2.0).
Apache License 2.0
136 stars 81 forks source link

Get Report Function Not Allowing all data to be returned in a Single Page #184

Open matthew1davis opened 2 years ago

matthew1davis commented 2 years ago

According the Smartsheet API documentation, the Get Report endpoint should allow all rows of a Summary Report to be returned when you do not enter the pageSize or page query parameters in the API call:

If neither pageSize nor page is specified, returns all rows in the sheet.

However, when I use the get_report function in practice, the page_size argument must be still defaulting to 100, because I only get the first 100 rows of my Summary Report returned.

import smartsheet

report_name = "My Summary Report Example"

# Get Report Id using name
action = smartsheet_client.Reports.list_reports(include_all=True)
reports = action.data
for report_info in reports:
    if report_info.name == report_name:
        report_id = report_info.id

# Retrieve rows from Report
sheet = smartsheet_client.Reports.get_report(report_id, page_size=None, page=None, level=2)

I tried setting page_size=None only, both page_size=None and page=None (as shown in code snippet above), and omitting page_size entirely, but none of those combinations were able to return my full report (181 rows). Only when I explicitly set page_size=200 then did my result return as expected (all 181 rows).