{"action":"created","issue":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/259","labels_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/259/comments","events_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/259/events","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/259","id":78926009,"number":259,"title":"merge_range and text_wrap","user":{"login":"smorstabilini","id":551983,"avatar_url":"https://avatars.githubusercontent.com/u/551983?v=3","gravatar_id":"","url":"https://api.github.com/users/smorstabilini","html_url":"https://github.com/smorstabilini","followers_url":"https://api.github.com/users/smorstabilini/followers","following_url":"https://api.github.com/users/smorstabilini/following{/other_user}","gists_url":"https://api.github.com/users/smorstabilini/gists{/gist_id}","starred_url":"https://api.github.com/users/smorstabilini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smorstabilini/subscriptions","organizations_url":"https://api.github.com/users/smorstabilini/orgs","repos_url":"https://api.github.com/users/smorstabilini/repos","events_url":"https://api.github.com/users/smorstabilini/events{/privacy}","received_events_url":"https://api.github.com/users/smorstabilini/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/labels/ready%20to%20close","name":"ready to close","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars.githubusercontent.com/u/94267?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-05-21T10:09:15Z","updated_at":"2015-06-11T13:55:37Z","closed_at":"2015-05-21T10:36:31Z","body":"I tried to merge some cells and to write in them using merge_range, passing a style with text_wrap set to True.  Unfortunately the row height is not auto expanded. \r\nSetting the row height manually is not very precise as it's very difficult to accurately calculate how many rows a string needs... \r\n\r\n```python\r\n    from xlsxwriter.workbook import Workbook\r\n\r\n    workbook = Workbook('wrap_text2.xlsx')\r\n    worksheet = workbook.add_worksheet()\r\n\r\n    # Widen the first column to make the text clearer.\r\n    worksheet.set_column('A:A', 20)\r\n\r\n    # Add a cell format with text wrap on.\r\n    cell_format = workbook.add_format({'text_wrap': True})\r\n\r\n    worksheet.merge_range(1,0,1,3, \"Line 111111   aaaaaaaaa bbbbbbb ccccc \\nLine 2 ddddddd  eeeee ffffff \\nLine 3\", cell_format)\r\n\r\n    workbook.close()\r\n```\r\n\r\nIs this an excel issue? Any possible workaround? \r\nThanks"},"comment":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/comments/111143787","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/259#issuecomment-111143787","issue_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/259","id":111143787,"user":{"login":"jkyeung","id":4826859,"avatar_url":"https://avatars.githubusercontent.com/u/4826859?v=3","gravatar_id":"","url":"https://api.github.com/users/jkyeung","html_url":"https://github.com/jkyeung","followers_url":"https://api.github.com/users/jkyeung/followers","following_url":"https://api.github.com/users/jkyeung/following{/other_user}","gists_url":"https://api.github.com/users/jkyeung/gists{/gist_id}","starred_url":"https://api.github.com/users/jkyeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkyeung/subscriptions","organizations_url":"https://api.github.com/users/jkyeung/orgs","repos_url":"https://api.github.com/users/jkyeung/repos","events_url":"https://api.github.com/users/jkyeung/events{/privacy}","received_events_url":"https://api.github.com/users/jkyeung/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T13:55:37Z","updated_at":"2015-06-11T13:55:37Z","body":"<blockquote>Excel sometimes adjust the height of the row automatically but this cannot be controlled from the file format. Therefore, you shouldn't rely on this and you should explicitly set the height of the row.</blockquote>\r\nI'd just like to add that merged cells are a case where Excel *specifically does NOT* adjust the row height automatically, regardless of the wrap setting."}}