{"id":10008077,"date":"2023-07-12T08:59:19","date_gmt":"2023-07-12T00:59:19","guid":{"rendered":"https:\/\/ityet.com\/?p=10008077"},"modified":"2023-07-12T08:59:19","modified_gmt":"2023-07-12T00:59:19","slug":"%e4%bd%bf%e7%94%a8springbootreact%e6%90%ad%e5%bb%ba%e4%b8%80%e4%b8%aaexcel%e6%8a%a5%e8%a1%a8%e5%b9%b3%e5%8f%b0","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10008077","title":{"rendered":"\u4f7f\u7528SpringBoot+React\u642d\u5efa\u4e00\u4e2aExcel\u62a5\u8868\u5e73\u53f0"},"content":{"rendered":"<blockquote><p>\u6458\u8981\uff1a\u672c\u6587\u7531\u8461\u8404\u57ce\u6280\u672f\u56e2\u961f\u4e8e\u601d\u5426\u539f\u521b\u5e76\u9996\u53d1\u3002\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1a<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=X06TUPn%2FfPiwW4%2BpQTmh4g%3D%3D.5f8fFVUdjVM891KKuNrGA4olPeE4Uwh%2BYFE4WPfVkMM%3D\" rel=\"noopener noreferrer\">\u8461\u8404\u57ce\u5b98\u7f51<\/a>\uff0c\u8461\u8404\u57ce\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e13\u4e1a\u7684\u5f00\u53d1\u5de5\u5177\u3001\u89e3\u51b3\u65b9\u6848\u548c\u670d\u52a1\uff0c\u8d4b\u80fd\u5f00\u53d1\u8005\u3002<\/p><\/blockquote>\n<h2>\u524d\u8a00<\/h2>\n<p>Excel\u62a5\u8868\u5e73\u53f0\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u3001\u64cd\u4f5c\u7b80\u5355\u7684\u7cfb\u7edf\u5e73\u53f0\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u4e0a\u4f20\u3001\u7f16\u8f91\u548c\u5206\u6790\u62a5\u8868\u6570\u636e\uff0c\u5b9e\u73b0\u6570\u636e\u53ef\u89c6\u5316\u3002<\/p>\n<p>\u672c\u6587\u6240\u63cf\u8ff0\u7684\u8fd9\u4e2a\u5e73\u53f0\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u529f\u80fd\uff1a<\/p>\n<ol>\n<li>\u6253\u5f00\u670d\u52a1\u5668\u4e0a\u73b0\u6709\u7684Excel\u6587\u4ef6\u3002<\/li>\n<li>\u8c03\u7528ToJson\u5e76\u5c06ssjson\u4f20\u8f93\u5230\u5ba2\u6237\u7aef\u3002<\/li>\n<li>\u5728\u6d4f\u89c8\u5668\u4e2d\uff0c\u4ece\u670d\u52a1\u5668\u8c03\u7528\u5e26\u6709ssjson\u7684fromJSON\u3002<\/li>\n<li>\u53ef\u4ee5\u770b\u5230Excel\u6a21\u677f\u7684\u5185\u5bb9\u3002<\/li>\n<li>\u53ef\u4ee5\u5728\u7ebf\u7f16\u8f91\u6a21\u677f\u6216\u586b\u5145\u6a21\u677f\u4e0a\u7684\u6570\u636e\u3002<\/li>\n<li>\u53ef\u4ee5\u4e0b\u8f7d\u67e5\u770bExcel\u6587\u4ef6\u4e2d\u7684\u66f4\u6539\u4e4b\u540e\u7684\u5185\u5bb9\u3002<\/li>\n<\/ol>\n<h2>\u9879\u76ee\u622a\u56fe<\/h2>\n<p><strong>Excel\u6a21\u677f\u6f14\u793a\uff1a<\/strong><\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998521\" alt=\"\" title=\"\"><\/p>\n<p><strong>\u6295\u6807\u8ddf\u8e2a\u5668\uff1a<\/strong><br \/><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998522\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u5f85\u529e\u4e8b\u9879\u5217\u8868\uff1a<\/strong><br \/><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998523\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u901a\u8baf\u7c3f\uff1a<\/strong><\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998524\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u4e0a\u4f20\u62a5\u8868\u6587\u4ef6\uff1a<\/strong><\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998525\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h2>\u4e3b\u8981\u4ee3\u7801\uff1a<\/h2>\n<p><strong>\u524d\u7aef\uff08React\uff09\u4ee3\u7801\u6587\u4ef6\u8def\u5f84\uff1a<\/strong><\/p>\n<pre><code>src\n\n\u2502 boot.tsx\n\n\u2502 GC.GcExcel.d.ts\n\n\u2502 routes.tsx\n\n\u2502 tree.txt\n\n\u2502 utility.ts\n\n\u2502 \n\n\u251c\u2500components\n\n\u2502   ExcelIODemo.tsx\n\n\u2502   ExcelTemplateDemo.tsx\n\n\u2502   Home.tsx\n\n\u2502   Layout.tsx\n\n\u2502   NavMenu.tsx\n\n\u2502   ProgrammingDemo.tsx\n\n\u2502   \n\n\u251c\u2500css\n\n\u2502   react-select.css\n\n\u2502   site.css\n\n\u2502   vendor.css\n\n\u2502   \n\n\u2514\u2500spread.sheets\n\n  \u2502 gc.spread.sheets.all.11.0.6.min.js\n\n  \u2502 gc.spread.sheets.Excel2013white.11.0.6.css\n\n  \u2502 gc.spread.sheets.Excel2016colorful.11.0.6.css\n\n  \u2502 \n\n  \u2514\u2500pluggable\n\n\u200b      gc.spread.sheets.charts.11.0.6.min.js<\/code><\/pre>\n<h3>\u524d\u7aef\u4ee3\u7801\uff1a<\/h3>\n<p>1.<strong>Excel\u6a21\u677f\u6f14\u793a\u9875\u9762\uff08ExcelTemplateDemo.tsx\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"javascript\">public render() {  \n return &lt;div className='spread-page'&gt;  \n &lt;h1&gt;Excel Template Demo&lt;\/h1&gt;  \n &lt;p&gt;This example demonstrates how to use &lt;strong&gt;GcExcel&lt;\/strong&gt; as server spreadsheet model, and use &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; as client side viewer or editor: &lt;\/p&gt;  \n &lt;ul&gt;  \n &lt;li&gt;&lt;strong&gt;GcExcel&lt;\/strong&gt; will first open an Excel file existing on server.&lt;\/li&gt;  \n &lt;li&gt;&lt;strong&gt;GcExcel&lt;\/strong&gt; then inoke &lt;strong&gt;ToJson&lt;\/strong&gt; and transport the ssjson to client side.&lt;\/li&gt;  \n &lt;li&gt;In browser, &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; will invoke &lt;strong&gt;fromJSON&lt;\/strong&gt; with the ssjson from server.&lt;\/li&gt;  \n &lt;li&gt;Then, you can see the content of the Excel template in &lt;strong&gt;Spread.Sheets&lt;\/strong&gt;.&lt;\/li&gt;  \n &lt;li&gt;At same time, you can fill or edit data on the template through &lt;strong&gt;Spread.Sheets&lt;\/strong&gt;.&lt;\/li&gt;  \n &lt;li&gt;At last, you can download to view the changes in Excel file.&lt;\/li&gt;  \n &lt;\/ul&gt;  \n &lt;br&gt;  \n &lt;div id='spreadjs' className='spread-div' &gt;  \n &lt;\/div&gt;;  \n}  \n\ncomponentDidMount() {  \n this.spread = new GC.Spread.Sheets.Workbook(**document**.getElementById('spreadjs'), {  \n seetCount: 1  \n });  \n\n this.loadSpreadFromTemplate();  \n}<\/code><\/pre>\n<p><strong>2.<\/strong> <strong>\u7f16\u7a0bAPI\u6f14\u793a\u754c\u9762\uff08\u6295\u6807\u8ddf\u8e2a\u5668\u3001\u5f85\u529e\u4e8b\u9879\u5217\u8868\u3001\u901a\u8baf\u7c3f\uff09\uff08ProgrammingDemo.tsx\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"javascript\">public render() {  \n return &lt;div className='spread-page'&gt;  \n &lt;h1&gt;Programming API Demo&lt;\/h1&gt;  \n &lt;p&gt;This example demonstrates how to programme with &lt;strong&gt;GcExcel&lt;\/strong&gt; to generate a complete spreadsheet model at server side, you can find all of source code in the SpreadServicesController.cs, we use &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; as client side viewer. &lt;\/p&gt; &lt;ul&gt;  \n &lt;li&gt;You can first program with &lt;strong&gt;GcExcel&lt;\/strong&gt; at server side.&lt;\/li&gt;  \n &lt;li&gt;&lt;strong&gt;GcExcel&lt;strong&gt; then inoke &lt;strong&gt;ToJson&lt;\/strong&gt; and transport the ssjson to client side.&lt;\/li&gt;  \n &lt;li&gt;In browser, &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; will invoke &lt;strong&gt;fromJSON&lt;\/strong&gt; with the ssjson from server.&lt;\/li&gt;  \n &lt;li&gt;Then, you can view the result in &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; or download it as Excel file.&lt;\/li&gt;  \n &lt;\/ul&gt;  \n &lt;br&gt;  \n &lt;div className='btn-group'&gt;  \n &lt;Select className='select'  \n name=&quot;form-field-name&quot;  \n value={this.state.value}  \n options={this.state.options}  \n onChange={this.onUseCaseChange} &gt;  \n &lt;button className='btn btn-default btn-md' onClick={this.exportExcel}&gt;Export Excel&lt;\/button&gt;  \n &lt;\/div&gt;  \n &lt;div id='spreadjs' className='spread-div' \/&gt;  \n &lt;\/div&gt;;  \n}  \n\ncomponentDidMount() {  \n this.spread = new GC.Spread.Sheets.Workbook(**document**.getElementById('spreadjs'), {  \n seetCount: 1  \n });  \n\n this.loadSpreadFromUseCase(this.state.value.value);  \n}<\/code><\/pre>\n<p><strong>3.Excel\u8f93\u5165\u548c\u8f93\u51fa\u6f14\u793a\u754c\u9762\uff08ExcelIODemo.tsx\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"javascript\">public render() {  \n return &lt;div className='spread-page'&gt;  \n &lt;h1&gt;Excel Input&amp;Output Demo&lt;\/h1&gt;  \n &lt;p&gt;This example demonstrates how to use &lt;strong&gt;GcExcel&lt;\/strong&gt; as server-side spreadsheet model, and use &lt;strong&gt;Spread.Sheets&lt;\/strong&gt; as the front-end side viewer and editor. &lt;\/p&gt;  \n &lt;ul&gt;  \n &lt;li&gt;&lt;strong&gt;GcExcel&lt;\/strong&gt; can import an Excel file and export to ssjson format, then transport the ssjson to client-side.&lt;\/li&gt;  \n &lt;\/ul&gt;  \n &lt;br\/&gt;  \n &lt;div className='btn-group'&gt;  \n &lt;input id=&quot;file&quot; className='btn btn-default btn-md' type='file' onChange={this.importExcel} title='Import Excel' \/&gt;  \n &lt;button className='btn btn-default btn-md' onClick={this.exportExcel}&gt;Export Excel&lt;\/button&gt;  \n &lt;\/div&gt;  \n &lt;div id='spreadjs' className='spread-div' \/&gt;  \n &lt;\/div&gt;;  \n}  \n\n*\/**  \n * \u5728\u5ba2\u6237\u7aef\u4e0a\u4f20\u4e00\u4e2aExcel\u6587\u4ef6\uff0c\u5728\u670d\u52a1\u5668\u7aef\u6253\u5f00\u8be5\u6587\u4ef6\uff0c\u7136\u540e\u5c06ssjson\u4f20\u8f93\u5230\u5ba2\u6237\u7aef  \n *\/  \n*importExcel(e : any) {  \n var selectedFile = e.target.files[0];  \n if (!selectedFile) {  \n this.selectedFileName = null;  \n return;  \n }  \n\n this.selectedFileName = selectedFile.name;  \n var requestUrl = '\/open';  \n fetch(requestUrl, {  \n method: 'POST',  \n body: selectedFile  \n }).then(response =&gt; response.json() as Promise&lt;object&gt;)  \n .then(data =&gt; {  \n this.spread.fromJSON(data);   \n });  \n}  \n\n*\/**  \n * \u4eceSpread.Sheets\u4f20\u8f93ssjson\u5e76\u4fdd\u5b58\u548c\u4e0b\u8f7dExcel\u6587\u4ef6  \n *\/  \n*exportExcel(e : any) {  \n var ssjson = **JSON**.stringify(this.spread.toJSON(null));  \n Utility.*ExportExcel*(ssjson, this.selectedFileName);  \n}<\/code><\/pre>\n<h3>\u540e\u7aef\u4ee3\u7801\uff1a<\/h3>\n<p>\u540e\u7aef\u4ee3\u7801\u4f7f\u7528<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=iIei%2FrtBN43xcmBKZR1feA%3D%3D.NtptZMH%2BB1fXYHXArWLYSHEjGfhIsYw5ahQbw8xmiXPcnXRLYk6cVtD5Iio8wpUweGKbs0gHcCpWpi185Q%2BBMH5PLizo5%2B9gE%2FpBOXA1EtM%3D\" rel=\"noopener noreferrer\">GCExcel<\/a>(\u4e00\u6b3e\u57fa\u4e8eJava\u7684\u62a5\u8868\u63d2\u4ef6)\u5b9e\u73b0\uff0c\u8be6\u7ec6\u7684\u4ee3\u7801\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><strong>\u540e\u7aef\u4ee3\u7801(SpringBoot)\u6587\u4ef6\u8def\u5f84\uff1a<\/strong><\/p>\n<pre><code>src:.\n\n\u2502\n\n\u2514\u2500main\n\n\u251c\u2500java\n\n\u2502 \u2514\u2500com\n\n\u2502 \u2514\u2500grapecity\n\n\u2502 \u2514\u2500documents\n\n\u2502 \u2514\u2500demo\n\n\u2502 \u2502 Application.java\n\n\u2502 \u2502\n\n\u2502 \u2514\u2500controller\n\n\u2502 GcExcelController.java\n\n\u2502\n\n\u2514\u2500resources\n\n\u2502 application.properties\n\n\u2502\n\n\u251c\u2500public\n\n\u2502 \u2502 bundle.js\n\n\u2502 \u2502 bundle.js.map\n\n\u2502 \u2502 favicon-16x16.png\n\n\u2502 \u2502 favicon-32x32.png\n\n\u2502 \u2502 index.html\n\n\u2502 \u2502\n\n\u2502 \u251c\u2500css\n\n\u2502 \u2502 site.css\n\n\u2502 \u2502 site.css.map\n\n\u2502 \u2502 vendor.css\n\n\u2502 \u2502\n\n\u2502 \u2514\u2500spreadJS\n\n\u2502 \u2502 gc.spread.sheets.all.11.0.6.min.js\n\n\u2502 \u2502 gc.spread.sheets.Excel2013white.11.0.6.css\n\n\u2502 \u2502 gc.spread.sheets.Excel2016colorful.11.0.6.css\n\n\u2502 \u2502\n\n\u2502 \u2514\u2500pluggable\n\n\u2502 gc.spread.sheets.charts.11.0.6.min.js\n\n\u2502\n\n\u2514\u2500static\n\n\u2514\u2500error\n\n404.html<\/code><\/pre>\n<ol>\n<li><strong>\u6295\u6807\u8ddf\u8e2a\u5668\uff08GcExcelController.java\uff09\uff1a<\/strong>\u4f7f\u7528\u5230\u4e86GcExcel\u7684<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=L84N11XdPdH2oIETn6bvQQ%3D%3D.e%2FfEdSRr9vsFvbO3s1kkePoiaPNj4ZbaUL32n1f3IwcfxrVdKTU716BngcNnA4Z2cQhKBLEA8P0msLLJgCVBoSgXOVKHa%2BLqlJfpxwiYU6kQZw2s%2B0TnjCK0Cm9ndwH%2B\" rel=\"noopener noreferrer\">\u5355\u5143\u683c\u5185\u6807\u7b7e<\/a>\u8c03\u6574\u8868\u683c\u5927\u5c0f\u3002<\/li>\n<\/ol>\n<pre><code class=\"java\">Workbook workbook = new Workbook();  \n\nIWorksheet worksheet = workbook.getWorksheets().get(0);  \n\n\/\/***********************Set RowHeight &amp; ColumnWidth***************  \nworksheet.setStandardHeight(30);  \nworksheet.getRange(&quot;1:1&quot;).setRowHeight(57.75);  \nworksheet.getRange(&quot;2:9&quot;).setRowHeight(30.25);  \nworksheet.getRange(&quot;A:A&quot;).setColumnWidth(2.71);  \nworksheet.getRange(&quot;B:B&quot;).setColumnWidth(11.71);  \nworksheet.getRange(&quot;C:C&quot;).setColumnWidth(28);  \n\n\/\/**************************Set Table Value &amp; Formulas*********************  \nITable table = worksheet.getTables().add(worksheet.getRange(&quot;B2:H9&quot;), true);  \nworksheet.getRange(&quot;B2:H9&quot;)  \n .setValue(new Object[][] { { &quot;BID #&quot;, &quot;DESCRIPTION&quot;, &quot;DATE RECEIVED&quot;, &quot;AMOUNT&quot;, &quot;PERCENT COMPLETE&quot;, &quot;DEADLINE&quot;, &quot;DAYS LEFT&quot; }, { 1, &quot;Bid number 1&quot;, null, 2000, 0.5, null, null },  \n { 2, &quot;Bid number 2&quot;, null, 3500, 0.25, null, null }, { 3, &quot;Bid number 3&quot;, null, 5000, 0.3, null, null }, { 4, &quot;Bid number 4&quot;, null, 4000, 0.2, null, null },;  \nworksheet.getRange(&quot;B1&quot;).setValue(&quot;Bid Details&quot;);  \nworksheet.getRange(&quot;D3&quot;).setFormula(&quot;=TODAY()-10&quot;);  \nworksheet.getRange(&quot;D4:D5&quot;).setFormula(&quot;=TODAY()-20&quot;);  \n\/\/****************************Set Table   \nITableStyle tableStyle = workbook.getTableStyles().add(&quot;Bid Tracker&quot;);  \nworkbook.setDefaultTableStyle(&quot;Bid Tracker&quot;);<\/code><\/pre>\n<ol>\n<li><strong>\u5f85\u529e\u4e8b\u9879\u5217\u8868\uff08GcExcelController.java\uff09\uff1a<\/strong>\u4f7f\u7528\u5230\u4e86GcExcel\u7684<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Ge8%2BrHpMAyBceBFhHIPBrA%3D%3D.kFcPst0bKhSCbcNEAu4Rapt2tkPALOAFpQ46gX06fGVSFW2K7wlbL%2BKlUqVVxE196PE%2Ft7D6vOK7w9GjWe8J8OqMapGNCBHsY9NrYiChOX2pqiFT3873qXcw6X%2BGiqtIBYj7thTaDFlxvnRxkoV1%2FJMcplYQ%2FucHMIlMnqHPMq4va7v8Ep87boG8mLq3nC1a\" rel=\"noopener noreferrer\">setValue<\/a>\u65b9\u6cd5\u7ed9\u8868\u683c\u5185\u5bb9\u8d4b\u503c\u3002<\/li>\n<\/ol>\n<pre><code class=\"java\">Workbook workbook = new Workbook();  \n\nObject[] data = new Object[][] { { &quot;TASK&quot;, &quot;PRIORITY&quot;, &quot;STATUS&quot;, &quot;START DATE&quot;, &quot;DUE DATE&quot;, &quot;% COMPLETE&quot;, &quot;DONE?&quot;, &quot;NOTES&quot; },  \n { &quot;First Thing I Need To Do&quot;, &quot;Normal&quot;, &quot;Not Started&quot;, null, null, 0, null, null }, { &quot;Other Thing I Need To Finish&quot;, &quot;High&quot;, &quot;In Progress&quot;, null, null, 0.5, null, null },  \n { &quot;Something Else To Get Done&quot;, &quot;Low&quot;, &quot;Complete&quot;, null, null, 1, null, null }, { &quot;More Errands And Things&quot;, &quot;Normal&quot;, &quot;In Progress&quot;, null, null, 0.75, null, null },  \n { &quot;So Much To Get Done This Week&quot;, &quot;High&quot;, &quot;In Progress&quot;, null, null, 0.25, null, null } };  \n\nIWorksheet worksheet = workbook.getWorksheets().get(0);  \nworksheet.setName(&quot;To-Do List&quot;);  \nworksheet.setTabColor(Color.*FromArgb*(148, 112, 135));  \nworksheet.getSheetView().setDisplayGridlines(false);  \n\n\/\/Set Value.  \nworksheet.getRange(&quot;B1&quot;).setValue(&quot;To-Do List&quot;);  \nworksheet.getRange(&quot;B2:I7&quot;).setValue(data);  \n\n\/\/Set formula.  \nworksheet.getRange(&quot;E3&quot;).setFormula(&quot;=TODAY()&quot;);  \nworksheet.getRange(&quot;E4&quot;).setFormula(&quot;=TODAY()-30&quot;);<\/code><\/pre>\n<p><strong>3.\u901a\u8baf\u7c3f\uff08GcExcelController.java\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"java\">Workbook workbook = new Workbook();  \n\nIWorksheet worksheet = workbook.getWorksheets().get(0);  \n\n\/\/ ***************************Set RowHeight &amp; Width****************************  \nworksheet.setStandardHeight(30);  \nworksheet.getRange(&quot;3:4&quot;).setRowHeight(30.25);  \nworksheet.getRange(&quot;1:1&quot;).setRowHeight(103.50);  \nworksheet.getRange(&quot;2:2&quot;).setRowHeight(38.25);  \nworksheet.getRange(&quot;A:A&quot;).setColumnWidth(2.625);  \nworksheet.getRange(&quot;B:B&quot;).setColumnWidth(22.25);  \n\n\n\/\/ *******************************Set Table Value &amp;  \n\/\/ Formulas*************************************  \nITable table = worksheet.getTables().add(worksheet.getRange(&quot;B2:L4&quot;), true);  \nworksheet.getRange(&quot;B2:L4&quot;)  \n .setValue(new Object[][] { { &quot;NAME&quot;, &quot;WORK&quot;, &quot;CELL&quot;, &quot;HOME&quot;, &quot;EMAIL&quot;, &quot;BIRTHDAY&quot;, &quot;ADDRESS&quot;, &quot;CITY&quot;, &quot;STATE&quot;, &quot;ZIP&quot;, &quot;NOTE&quot; },  \n { &quot;Kim Abercrombie&quot;, 1235550123, 1235550123, 1235550123, &quot;someone@example.com&quot;, null, &quot;123 N. Maple&quot;, &quot;Cherryville&quot;, &quot;WA&quot;, 98031, &quot;&quot; },  \n { &quot;John Smith&quot;, 3215550123L, &quot;&quot;, &quot;&quot;, &quot;someone@example.com&quot;, null, &quot;456 E. Aspen&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot; }, });  \nworksheet.getRange(&quot;B1&quot;).setValue(&quot;ADDRESS BOOK&quot;);  \nworksheet.getRange(&quot;G3&quot;).setFormula(&quot;=TODAY()&quot;);  \nworksheet.getRange(&quot;G4&quot;).setFormula(&quot;=TODAY()+5&quot;);  \n\n\/\/ ****************************Set Table Style********************************  \nITableStyle tableStyle = workbook.getTableStyles().add(&quot;Personal Address Book&quot;);  \nworkbook.setDefaultTableStyle(&quot;Personal Address Book&quot;);  \n\n\/\/ Set WholeTable element style.  \n\/\/ Set FirstColumn element style.  \ntableStyle.getTableStyleElements().get(TableStyleElementType.*FirstColumn*).getFont().setBold(true);  \n\n\/\/ Set SecondColumns element style.  \ntableStyle.getTableStyleElements().get(TableStyleElementType.*HeaderRow*).getBorders().setColor(Color.*FromArgb*(179, 35, 23));  \ntableStyle.getTableStyleElements().get(TableStyleElementType.*HeaderRow*).getBorders().get(BordersIndex.*EdgeTop*).setLineStyle(BorderLineStyle.*Thick*);  \ntableStyle.getTableStyleElements().get(TableStyleElementType.*HeaderRow*).getBorders().get(BordersIndex.*EdgeBottom*).setLineStyle(BorderLineStyle.*Thick*);<\/code><\/pre>\n<h2>\u5b8c\u6574\u4ee3\u7801\uff1a<\/h2>\n<p>\u60f3\u8981\u83b7\u53d6\u5b8c\u6574\u4ee3\u7801\u7684\u7ae5\u978b\u53ef\u4ee5\u8bbf\u95ee\u70b9\u51fb\u4e0b\u65b9\u94fe\u63a5\uff1a<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=MvlcXMrNGQai9F2Y906YOw%3D%3D.zW4seuUldKdBBuG9SqWa3EyMpcY%2B8Rf3DwuXTyQrfhbMJ6088nmLiTWPr%2FvjVYMs38Ra%2BYyzNy5QipqOXyXYtQ%3D%3D\" rel=\"noopener noreferrer\">https:\/\/github.com\/GrapeCityXA\/GcExcel-Java\/tree\/master<\/a> \uff08Github\uff09<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=g7k6V0qnkPJ4W%2B8%2Fyh1xiA%3D%3D.0gASzZoNR5vjtCbaX2n0PzoEs2LKjyfS8wReTbr527OpnS3ZOmz7hzmVyGMr8FIA\" rel=\"noopener noreferrer\">https:\/\/gitee.com\/GrapeCity\/GcExcel-Java<\/a> (Gitee)<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043998526\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u672c\u9879\u76ee\u4e3a\u524d\u540e\u7aef\u4e00\u4f53\u5316\uff0c\u62c9\u53d6\u5b8c\u6574\u4ee3\u7801\u540e\u76f4\u63a5\u4f7f\u7528IDEA\u6253\u5f00\u4e0b\u8f7d\u8d44\u6e90\u5305\u540e\u8fd0\u884c\u5373\u53ef\u3002<\/p>\n<p>\u8fd0\u884c\u540e\u7684\u9ed8\u8ba4\u7aef\u53e3\u4e3alocalhost:8080\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u8bbf\u95ee<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=SWKFJsFWIWBuL9TkfUSVyA%3D%3D.QtXisior4cE4EJg6JkzxWzvTy%2FdSlWmpcvW%2FnxQwO02TsnHj1YiEgTFgz7uQJGBZOLniqQtUaHFbHnYMLMcyuDadqdNNybIG2XkcZ%2F4WBf4QXrO2%2FIxwabIFHYqv%2FwSvb%2FJyagy9Q0BqDkArYuAGuw%3D%3D\" rel=\"noopener noreferrer\">GcExcel\u5b98\u7f51<\/a>\u4e86\u89e3\u66f4\u591a\u6709\u5173\u4e8e\u62a5\u8868\u7684\u529f\u80fd\u3002<\/p>\n<h2>\u6269\u5c55\u94fe\u63a5\uff1a<\/h2>\n<p><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=%2FID99JyKYDYM%2Bc0jJgKm7w%3D%3D.YMCiEkxo%2Bzpmpd0oRxBR9JVy%2Bh%2FDveQVKfsQPMG4MgURO2FCrgVdgGiXpu%2FlitWNVZkxbQPVB73aUeHNAiGOww%3D%3D\" rel=\"noopener noreferrer\">\u9879\u76ee\u5b9e\u6218\uff1a\u5728\u7ebf\u62a5\u4ef7\u91c7\u8d2d\u7cfb\u7edf\uff08React +SpreadJS+Echarts\uff09<\/a><\/p>\n<p><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=vlnsGdftmNLV8G%2BrpvX9zA%3D%3D.LYHb%2Bwspr%2FlYmFG9hiHyGMbyjPHhrMNXv66rfXvy1GtHccw%2FHZDZ58cPxpoIsPfb%2B4Xt7yhBm8%2BhMZ0hV99yZ6hF%2F3Kp8VyYHVnyj9acj%2BPAidfRXfdV0EvENTKXRaW1\" rel=\"noopener noreferrer\">Spring Boot\u6846\u67b6\u4e0b\u5b9e\u73b0Excel\u670d\u52a1\u7aef\u5bfc\u5165\u5bfc\u51fa<\/a><\/p>\n<p><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=QFmBK%2BHLMT77QWSm0JFOlA%3D%3D.PvO9YHiAOO0PGy7zKFRsgxWqpkBZGa%2FeN1TLHCr8mkgunJvQ1fGLvYPSNYAUR5PqPAB5gE0p3BBq7rt8oVSPSw%3D%3D\" rel=\"noopener noreferrer\">\u5d4c\u5165\u5f0fBI \u4e0eOEM\u6a21\u5f0f<\/a><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043998519\">https:\/\/segmentfault.com\/a\/1190000043998519<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981\uff1a\u672c\u6587\u7531\u8461\u8404\u57ce\u6280\u672f\u56e2\u961f\u4e8e\u601d\u5426\u539f\u521b\u5e76\u9996\u53d1\u3002\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1a\u8461\u8404\u57ce\u5b98\u7f51\uff0c\u8461\u8404\u57ce\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e13\u4e1a\u7684\u5f00\u53d1\u5de5\u5177\u3001\u89e3\u51b3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10008077","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10008077"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008077\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10008077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10008077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10008077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}