simple_xlsx_reader icon indicating copy to clipboard operation
simple_xlsx_reader copied to clipboard

Chart pages cause discrepancies in page names

Open bmck opened this issue 5 months ago • 0 comments

Consider a workbook that contains a "chart page" (described at https://support.microsoft.com/en-us/office/print-a-chart-on-a-full-page-581d7656-fdb7-4532-8e17-238d5879962e). An example can be found attached, named GDPTrackingModelDataAndForecasts.xlsx, taken from https://www.atlantafed.org/-/media/documents/cqer/researchcq/gdpnow/GDPTrackingModelDataAndForecasts.xlsx, with the chart page named "Chart1".

Accessing pages -- after the chart page -- by name do not result in the correct data being located. Consider the following code:

require 'open-uri' require 'simple_xlsx_reader'

doc2 = SimpleXlsxReader.parse(URI.open('https://www.atlantafed.org/-/media/documents/cqer/researchcq/gdpnow/GDPTrackingModelDataAndForecasts.xlsx')) ary2 = doc2.sheets.detect{|sht| sht.name == 'TrackRecord'}.rows.to_a

After running the code, ary2 contains the data from the page following the one desired, "TrackingDeepArchives".

bmck avatar Sep 13 '24 15:09 bmck