Export Column Width for Excel Issue

(3 posts) (2 voices)
  • Started 2 years ago by nsepetys
  • Latest reply from nsepetys
  1. nsepetys, Member

    Hello myDBR Representative,

    How are things going? I am experiencing an issue with the SELECT 'dbr.export.options', 'colwidth' functionality. It appears the colwidth isn't respecting some of the larger columns with lots of text. Below is an example (see the "Continent" column) that doesn't appear to be working when exported to excel. If it isn't replicable on your end it might be because we're running an older version (v. 4.7.1 (build 3178)). See code sql print out from demo below:

    select 'dbr.title', 'Afghanistan Details'; select 'dbr.subtitle', 'Facts & Figures';

    select 'dbr.export.options', 'colwidths', 45, 88, 70, 30, 15, 19, 12, 18, 26, 25, 18, 16;

    select 'Afghanistan' as 'Name', 'AFG' as 'Country code', 'Asia234 2304809832409 023984092384 0932840- 83240823094803298409234809238 098 2340982309480238 409823409 82309480' as 'Continent', 'Southern and Central Asia' as 'Region', 652090.0 as 'Surface Area', 1919 as 'Independent Year', 22720000 as 'Population', 45.9 as 'Life Expectancy', 5976.0 as 'Gross national product', 'Afganistan/Afqanestan' as 'Local name', 'Islamic Emirate' as 'Gevernment form', 'Mohammad Omar' as 'Head of state';

    select 'dbr.googlemaps', 'address', 'Biggest cities in Afghanistan', 400, 400;

    select 'Kabul, Afghanistan' as 'CONCAT( c.Name, \', \' , vCountry_name )', 'Kabul, Afghanistan
    Population: 1780000' as 'CONCAT( c.Name, \', \', vCountry_name, \'
    Population: \', c.Population )', 'green-dot' as 'if ( c.ID = o.Capital, \'green-dot\', \'\' )' union all select 'Qandahar, Afghanistan', 'Qandahar, Afghanistan
    Population: 237500', '' union all select 'Herat, Afghanistan', 'Herat, Afghanistan
    Population: 186800', '' union all select 'Mazar-e-Sharif, Afghanistan', 'Mazar-e-Sharif, Afghanistan
    Population: 127800', '';

    select 'dbr.title', 'Cities & Districts in Afghanistan';

    select 'dbr.chart', 'Bar', 'Biggest cities in Afghanistan';

    select 'dbr.report', 'sp_DBR_demo_city', 'inCity=1';

    select 'dbr.keepwithnext';

    select 'Kabul' as 'Name', 1780000 as 'Population' union all select 'Qandahar', 237500 union all select 'Herat', 186800 union all select 'Mazar-e-Sharif', 127800;

    select 'dbr.chart', 'Pie', 'Population in Afghanistan';

    select 'Kabol' as 'District', 1780000 as 'Population' union all select 'Qandahar', 237500 union all select 'Herat', 186800 union all select 'Balkh', 127800;

    select 'dbr.title', 'Cities of Afghanistan';

    select 'dbr.report', 'sp_DBR_demo_city', 'inCity=1';

    select 'dbr.count', 1; select 'dbr.sum', 3;

    select 'Kabul' as 'Name', 'Kabol' as 'District', 1780000 as 'Population' union all select 'Qandahar', 'Qandahar', 237500 union all select 'Herat', 'Herat', 186800 union all select 'Mazar-e-Sharif', 'Balkh', 127800;

    select 'dbr.button', 'Show how this report is done'; select 'dbr.report', 'sp_DBR_demo_show_source', 'inProcName=1';

    select 'sp_DBR_demo_country' as 'inProcName';

    Please note, on my end the report I have is just a table. So I can say definitively it doesn't have anything to do with the charts or other objects on the page- just something in the table. But this demo seems to show the issue just fine on my end. Let me know if you have any other questions.

    - Noah

    Posted 2 years ago #
  2. myDBR Team, Key Master

    if you have multiple result sets in Excel export, you can use

    select 'dbr.export.options', 'autosize', 0;

    --
    myDBR Team

    Posted 2 years ago #
  3. nsepetys, Member

    That appears to have done it. Although I only have 1 result set (unlike what was in the demo above) for the report I'm using so I'm not sure why there was autosizing overriding the explicit excel column widths. Thanks for your help

    Posted 2 years ago #

Reply

You must log in to post.