<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Documentation – AutoFit Rows and Columns with Golang via C&#43;&#43;</title>
    <link>https://docs.aspose.com/cells/go-cpp/autofit-rows-and-columns/</link>
    <description>Recent content in AutoFit Rows and Columns with Golang via C&#43;&#43; on Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="https://docs.aspose.com/cells/go-cpp/autofit-rows-and-columns/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Gocpp: AutoFit Row Height Automatically When Loading a File with Go</title>
      <link>https://docs.aspose.com/cells/gocpp/autofit-row-height/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/gocpp/autofit-row-height/</guid>
      <description>
        
        
        &lt;h2 id=&#34;possible-usage-scenarios&#34;&gt;&lt;strong&gt;Possible Usage Scenarios&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The height of a row automatically matches the font of its content, but when the height of the cached row does not match the height of the content in the file, MS Excel will automatically adjust the row height when loading the file, whereas Aspose.Cells will not automatically adjust it in order to improve performance. If you need Aspose.Cells to automatically match row heights when loading files, you can achieve this by using the parameter &lt;a href=&#34;https://reference.aspose.com/cells/cpp/aspose.cells/autofitteroptions/getonlyauto/&#34;&gt;LoadOptions.GetOnlyAuto()&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please refer to the following image. We can observe that the cached row height in row 11 is 15, but Excel automatically adjusts the row height when loading the file.&lt;br&gt;
&lt;br&gt;
&lt;img src=&#34;1.png&#34; width=70% /&gt;&lt;/p&gt;
&lt;h2 id=&#34;adjust-row-height-using-asposecells&#34;&gt;&lt;strong&gt;Adjust Row Height using Aspose.Cells&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;If you load the file directly and save it to PDF, the data will not be fully displayed in the PDF because the cached row height is only 15.&lt;br&gt;
&lt;br&gt;
&lt;img src=&#34;2.png&#34; width=70% /&gt;
&lt;br&gt;
If you set the parameter &lt;a href=&#34;https://reference.aspose.com/cells/cpp/aspose.cells/autofitteroptions/getonlyauto/&#34;&gt;LoadOptions.GetOnlyAuto()&lt;/a&gt; to &lt;strong&gt;true&lt;/strong&gt; when loading the file, Aspose.Cells will automatically adjust the row height. The adjusted row height can effectively meet the text‑display requirements.&lt;br&gt;
&lt;br&gt;
&lt;img src=&#34;3.png&#34; width=70% /&gt;&lt;/p&gt;
&lt;h2 id=&#34;go-sample-code&#34;&gt;&lt;strong&gt;Go Sample Code&lt;/strong&gt;&lt;/h2&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-AutoFitRowHeight.go&#34;&gt;&lt;/script&gt;


      </description>
    </item>
    
    <item>
      <title>Gocpp: AutoFit Rows for Merged Cells with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/autofit-rows-for-merged-cells/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/autofit-rows-for-merged-cells/</guid>
      <description>
        
        
        

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

Microsoft Excel provides a feature that allows you to auto-size the height of a cell according to its content. The feature is called auto‑fit rows. Microsoft Excel doesn&amp;rsquo;t set auto‑fit operation on merged cells natively. Sometimes the feature becomes vital for a user who really needs to implement auto‑fit rows on merged cells too.
&lt;/div&gt;

&lt;h2 id=&#34;how-to-use-autofitmergedcellstype-for-autofitting-rows&#34;&gt;&lt;strong&gt;How to use AutoFitMergedCellsType for autofitting rows&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Aspose.Cells supports this feature through the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/autofitmergedcellstype/&#34;&gt;&lt;strong&gt;AutoFitterOptions.AutoFitMergedCellsType&lt;/strong&gt;&lt;/a&gt; API. Using this API, it is possible to auto‑fit rows in a worksheet, including merged cells. Here is a list of all possible types of auto‑fitting merged cells:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;li&gt;FirstLine&lt;/li&gt;
&lt;li&gt;LastLine&lt;/li&gt;
&lt;li&gt;EachLine&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;autofit-rows-for-merged-cells&#34;&gt;&lt;strong&gt;Autofit Rows for Merged Cells&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Please see the following code; it creates a workbook object and adds multiple worksheets. Use different methods for autofit operations in each worksheet. The screenshot shows the results after the execution of the sample code.&lt;/p&gt;
&lt;br&gt;
&lt;img src=&#34;result.png&#34; width=80% /&gt;
&lt;h2 id=&#34;c-sample-code&#34;&gt;&lt;strong&gt;C++ Sample Code&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-AutofitRowsForMergedCells.go&#34;&gt;&lt;/script&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Gocpp: AutoFit Rows for Rendering with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/autofit-rows-for-rendering/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/autofit-rows-for-rendering/</guid>
      <description>
        
        
        &lt;p&gt;Generally, when you want to display all the text in a cell, you can autofit the row in Normal view with 100 % zoom in Microsoft Excel. This allows the text to be fully visible in Normal view, and even when you print or save the file as a PDF, the text will be displayed correctly.&lt;/p&gt;
&lt;p&gt;However, in some cases, autofitting the row works fine in Normal view, but when you switch to Print View or save the file as a PDF, the text gets clipped. Please check the source file &lt;a href=&#34;Book1.xlsx&#34;&gt;Book1.xlsx&lt;/a&gt; and screenshots.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;text_clipped_in_printview.png&#34; alt=&#34;text is clipped in print view&#34;&gt;&lt;/p&gt;
&lt;p&gt;If you want to prevent text &lt;strong&gt;from&lt;/strong&gt; being clipped in the saved PDF file, you can autofit the row with the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/autofitteroptions/getforrendering/&#34;&gt;AutoFitterOptions.GetForRendering()&lt;/a&gt; option.&lt;/p&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-AutofitRowsForRendering.go&#34;&gt;&lt;/script&gt;

&lt;p&gt;Now, the text is not clipped in the output PDF file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;text_not_clipped_in_saved_pdf.png&#34; alt=&#34;text is not clipped in saved PDF&#34;&gt;
&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;
&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
