Skip to content

Commit a74ffa9

Browse files
committed
Revise README file.
1 parent e8bae8f commit a74ffa9

File tree

1 file changed

+206
-29
lines changed

1 file changed

+206
-29
lines changed

README.md

Lines changed: 206 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,106 @@ Aspose.Cells for Go via C++ is a native Go library designed for Go developers to
99

1010
## Environments and versions
1111

12-
- Go 1.13 or greater
12+
- Go 1.16 or greater
13+
14+
## Quick Start Guide
15+
16+
### Installation Aspose.Cells for Go via C++ package and running your code in your project {#Installation-in-your-project}
17+
18+
1. Create a directory for your project and a main.go file within. Add the following code to your main.go.
19+
20+
```Go
21+
22+
package main
23+
24+
import (
25+
. "github.com/aspose-cells/aspose-cells-go-cpp/v25"
26+
"fmt"
27+
)
28+
29+
func main() {
30+
lic, _ := NewLicense()
31+
lic.SetLicense_String("YOUR_LICENSE_File_PATH")
32+
workbook, _ := NewWorkbook()
33+
worksheets, _ := workbook.GetWorksheets()
34+
worksheet, _ := worksheets.Get_Int(0)
35+
cells, _ := worksheet.GetCells()
36+
cell, _ := cells.Get_String("A1")
37+
cell.PutValue_String_Bool("Hello World!", true)
38+
style, _ := cell.GetStyle()
39+
style.SetPattern(BackgroundType_Solid)
40+
color, _ := NewColor()
41+
color.Set_Color_R(uint8(255))
42+
color.Set_Color_G(uint8(128))
43+
style.SetForegroundColor(color)
44+
cell.SetStyle_Style(style)
45+
workbook.Save_String("HELLO.pdf")
46+
47+
}
48+
49+
```
50+
51+
1. Initialize project go.mod
52+
53+
```bash
54+
55+
go mod init main
56+
57+
```
58+
59+
1. Fetch the dependencies for your project.
60+
61+
```bash
62+
63+
go mod tidy
64+
65+
```
66+
67+
If Aspose.Cells for Go via C++ is not installed in the development environment, Go will automatically install the package in the `$GOPATH` subdirectory.
68+
69+
1. Set your PATH to point to the shared libraries in Aspose.Cells for Go via C++ in your current command shell. Replace your_version with the version of Aspose.Cells for Go via C++ you are running.
70+
71+
```bash
72+
73+
set PATH=%PATH%;%GOPATH%/pkg/mod/github.com/aspose-cells/aspose-cells-go-cpp/v25@v25.1.1/lib/linux_x86_64/
74+
75+
```
76+
77+
Or in your powershell
78+
79+
```powershell
80+
81+
$env:Path = $env:Path+ ";${env:GOPATH}\github.com\aspose-cells\aspose-cells-go-cpp\v25@v25.1.1\lib\win_x86_64\"
82+
83+
```
84+
85+
You may also copy the DLL files from the above path to the same place as your project executable.
86+
87+
1. Run your created application.
88+
89+
```bash
90+
91+
go run main.go
92+
93+
```
94+
95+
## **Rich Features**
96+
97+
Aspose.Cells for Go via C++ offers a wide arrange of features for creating, converting and manipulating spreadsheets:
98+
99+
- Built-In Properties
100+
- Custom Properties
101+
- Themes
102+
- Styles and Formatting
103+
- Data Validation
104+
- Conditional Formatting
105+
- Hyperlink
106+
- AutoFilter
107+
- PageSetup
108+
- Reading, Writing and Calculating Formulas
109+
- Group Rows and Columns
110+
- PivotTable
111+
- Table
13112

14113
## Support file format
15114

@@ -50,52 +149,130 @@ Aspose.Cells for Go via C++ is a native Go library designed for Go developers to
50149

51150
A commercial license key is required for use in a production environment. Please <a href="https://purchase.aspose.com/buy">contact us to purchase a commercial license</a> if you do not have a valid license key.
52151

53-
## Quick Start Guide
152+
## How to Install Aspose.Cells for Go via C++
54153

55-
### Running Aspose.Cells for Go via C++ in your project
154+
### **How to Install Aspose.Cells for Go via C++ Using the Go Command**
56155

57-
1. Import `github.com/aspose-cells/aspose-cells-go-cpp/v24` into your project
58-
a. On **Windows**, you will have to locate the DLLs for running the project and append them to your path.
156+
- From Go 1.16, you use `go install` command directly to install the Aspose.Cells for Go via C++ package. The command allows for the global installation of command-line tools without worrying about affecting existing project dependencies.
59157

60-
```
61-
$env:PATH = $env:Path + ";$env:GOPATH\github.com\aspose-cells\aspose-cells-go-cpp\v24@v24.12.0\lib\win_x86_64"
62-
```
158+
```go
63159

64-
b. On **Linux**, you will have to locate the DLLs for running the project and append them to your path.
160+
go install github.com/aspose-cells/aspose-cells-go-cpp/v25@latest
65161

66-
```
67-
set PATH=%GOPATH%/github.com/aspose-cells/aspose-cells-go-cpp/v24@your_version/libs/win/Lib/linux_x86_64
68-
```
69-
70-
You may also copy these directly to your project directory.
162+
```
71163

72-
2. Create a main.go in your project directory
164+
- When you use `go get` command to install the Aspose.Cells for Go via C++ package, need exist the go.mod file in the current directory or any parent directory. see to [installation Aspose.Cells for Go via C++ package and running your code in your project](#Installation-in-your-project)
73165

74166
```go
75167

168+
go get github.com/aspose-cells/aspose-cells-go-cpp/v25@v25.1.1
169+
170+
```
171+
172+
### **How to build Aspose.Cells for Go via C++ from the Source Code Package**
173+
174+
1. Download Aspose.Cells for Go via C++ source package
175+
176+
- **You can download the source code package from two locations:**
177+
178+
1. Download the source code package from the [Aspose.Cells for Go via C++ download page](https://downloads.aspose.com/cells/go-cpp/).
179+
1. Download the source code package from the [GitHub repository](https://github.com/aspose-cells/aspose-cells-go-cpp) or directly via [GitHub Archive Package](https://github.com/aspose-cells/aspose-cells-go-cpp/archive/refs/heads/main.zip).
180+
181+
2. How install Aspose.Cells for Go via C++ package into your project
182+
183+
- **Create a directory for your project and a main.go file within. Add the following code to your main.go.**
184+
185+
```Go
186+
76187
package main
77188

78189
import (
79-
. github.com/aspose-cells/aspose-cells-go-cpp/v24
190+
. "asposecells"
191+
"fmt"
80192
)
81193

82194
func main() {
83-
lic, _ := NewLicense()
84-
lic.SetLicense_String(os.Getenv("LicensePath"))
85-
workbook, _ := NewWorkbook()
86-
worksheets, _ := workbook.GetWorksheets()
87-
worksheet, _ := worksheets.Get_Int(0)
88-
cells, _ := worksheet.GetCells()
89-
cell, _ := cells.Get_String("A1")
90-
cell.PutValue_Int(5)
91-
cell, _ = cells.Get_String("A2")
92-
cell.PutValue_String("Hollo World")
93-
workbook.Save_String("HolloWorld.xlsx")
195+
lic, _ := NewLicense()
196+
lic.SetLicense_String("YOUR_LICENSE_File_PATH")
197+
workbook, _ := NewWorkbook()
198+
worksheets, _ := workbook.GetWorksheets()
199+
worksheet, _ := worksheets.Get_Int(0)
200+
cells, _ := worksheet.GetCells()
201+
cell, _ := cells.Get_String("A1")
202+
cell.PutValue_String_Bool("Hello World!", true)
203+
style, _ := cell.GetStyle()
204+
style.SetPattern(BackgroundType_Solid)
205+
color, _ := NewColor()
206+
color.Set_Color_R(uint8(255))
207+
color.Set_Color_G(uint8(128))
208+
style.SetForegroundColor(color)
209+
cell.SetStyle_Style(style)
210+
workbook.Save_String("HELLO.pdf")
211+
94212
}
95213

96214
```
97215

98-
### Create a table in excel
216+
- **Initialize project go.mod**
217+
218+
```bash
219+
220+
go mod init main
221+
222+
```
223+
224+
- **Extract the ZIP file to cells-go-cpp folder in your project directory.**
225+
226+
--cells-go-cpp-samples
227+
-- cells-go-cpp ( folder)
228+
-- start_up.go
229+
-- aspose_cells.go
230+
-- ......
231+
-- go.mod
232+
-- AsposeCellsCWrapper.h
233+
-- main.go
234+
-- go.mod
235+
236+
- **Modify your Go `mod` file to specify the package's location:**
237+
238+
```go
239+
module main
240+
241+
go 1.19
242+
243+
require github.com/aspose-cells/aspose-cells-go-cpp/v25 v25.1.0
244+
replace github.com/aspose-cells/aspose-cells-go-cpp/v25 v25.1.0 => ./cells-go-cpp
245+
```
246+
247+
- **Set your PATH to point to the shared libraries in Aspose.Cells for Go via C++ in your current command shell. Replace your_version with the version of Aspose.Cells for Go via C++ you are running.**
248+
249+
```bash
250+
251+
set PATH=%PATH%;%YourProjectPath%/cells-go-cpp-samples/cells-go-cpp/lib/win_x86_64/
252+
253+
```
254+
255+
Or in your powershell
256+
257+
```powershell
258+
259+
$env:Path = $env:Path+ ";${YourProjectPath}\cells-go-cpp-samples\cells-go-cpp\lib\win_x86_64\"
260+
261+
```
262+
263+
You may also copy the DLL files from the above path to the same place as your project executable.
264+
265+
- **Run your created application.**
266+
267+
```bash
268+
269+
go run main.go
270+
271+
```
272+
273+
### **Code samples**
274+
275+
#### Create a table in excel
99276

100277
```go
101278

@@ -164,7 +341,7 @@ func main() {
164341
}
165342
```
166343

167-
### Create bubble chart in excel
344+
#### Create bubble chart in excel
168345

169346
```go
170347

0 commit comments

Comments
 (0)