Skip to content

Commit 4b0bffc

Browse files
committed
Fix compile warning and add license.
1 parent dca32f4 commit 4b0bffc

File tree

3 files changed

+177
-2
lines changed

3 files changed

+177
-2
lines changed

AsposeCellsCWrapper.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extern "C" {
3737
#ifdef _WIN32
3838
ASPOSE_CELLS_API typedef GUID UUID;
3939
#endif
40+
#ifdef _WIN32
4041
ASPOSE_CELLS_API typedef struct {
4142
int return_value;
4243
int error_no;
@@ -84,7 +85,56 @@ extern "C" {
8485
int error_no;
8586
char* error_message;
8687
} c_return_ptr_value;
88+
#else
89+
typedef struct {
90+
int return_value;
91+
int error_no;
92+
char* error_message;
93+
} ASPOSE_CELLS_API c_return_int_value;
94+
typedef struct {
95+
bool return_value;
96+
int error_no;
97+
char* error_message;
98+
} ASPOSE_CELLS_API c_return_bool_value;
99+
typedef struct {
100+
char return_value;
101+
int error_no;
102+
char* error_message;
103+
} ASPOSE_CELLS_API c_return_char_value;
104+
typedef struct {
105+
float return_value;
106+
int error_no;
107+
char* error_message;
108+
} ASPOSE_CELLS_API c_return_float_value;
109+
ASPOSE_CELLS_API typedef struct {
110+
double return_value;
111+
int error_no;
112+
char* error_message;
113+
} c_return_double_value;
114+
typedef struct {
115+
long return_value;
116+
int error_no;
117+
char* error_message;
118+
} ASPOSE_CELLS_API c_return_long_value;
87119

120+
typedef struct {
121+
int error_no;
122+
char* error_message;
123+
} ASPOSE_CELLS_API c_return_void_value;
124+
125+
typedef struct {
126+
char* return_value;
127+
int error_no;
128+
char* error_message;
129+
} ASPOSE_CELLS_API c_return_string_value;
130+
131+
typedef struct {
132+
void* return_value;
133+
int error_no;
134+
char* error_message;
135+
} ASPOSE_CELLS_API c_return_ptr_value;
136+
137+
#endif
88138
ASPOSE_CELLS_API void Startup();
89139

90140
/**************Class AboveAverage *****************/

LICENSE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Copyright (c) 2024 Aspose.Cells
2+
3+
The End User License Agreement (“EULA”) contains the terms and conditions that govern Your use of Aspose’s products enclosed or otherwise accompanied herewith (individually and collectively, the “PRODUCT”) (as linked to below) and imposes material limitations on Your License. You should read the EULA carefully. BY INSTALLING, DOWNLOADING, COPYING OR OTHERWISE USING THE PRODUCT, YOU AGREE TO BE BOUND BY THE TERMS OF THE ASPOSE EULA.
4+
5+
You may obtain a copy of the Aspose EULA at: https://about.aspose.com/legal/eula

README.md

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,28 @@ A commercial license key is required for use in a production environment. Please
5353

5454
## Quick Start Guide
5555

56-
## Running Aspose.Cells for Go via C++ in your project
56+
### Running Aspose.Cells for Go via C++ in your project
5757

5858
1. Import `github.com/aspose-cells/aspose-cells-go-cpp/v24` into your project
5959
a. On **Windows**, you will have to locate the DLLs for running the project and append them to your path.
6060
```
61+
$env:PATH = $env:Path + ";$env:GOPATH\pkg\mod\github.com\aspose-cells\aspose-cells-go-cpp@v0.1.0\lib\win_x86_64"
62+
```
63+
b. On **Linux**, you will have to locate the DLLs for running the project and append them to your path.
64+
```
6165
set PATH=%GOPATH%/pkg/mod/github.com/aspose-cells/aspose-cells-go-cpp/v24@your_version/libs/win/Lib/win_x86_64
6266
```
67+
6368
You may also copy these directly to your project directory.
6469

6570
2. Create a main.go in your project directory
71+
6672
```go
6773

6874
package main
6975

7076
import (
71-
. github.com/aspose-cells/aspose-cells-go-cpp/v24
77+
. github.com/aspose-cells/aspose-cells-go-cpp
7278
)
7379

7480
func main() {
@@ -85,5 +91,119 @@ func main() {
8591
workbook.Save_String("HolloWorld.xlsx")
8692
}
8793

94+
```
95+
96+
### Create a table in excel
97+
98+
```go
99+
100+
package main
101+
102+
import (
103+
. github.com/aspose-cells/aspose-cells-go-cpp
104+
)
105+
106+
func main() {
107+
workbook, _ := NewWorkbook()
108+
worksheets, _ := workbook.GetWorksheets()
109+
worksheet, _ := worksheets.Get_Int(0)
110+
cells, _ := worksheet.GetCells()
111+
set_cell_string_value(cells, "A1", "Employee")
112+
set_cell_string_value(cells, "B1", "Quarter")
113+
set_cell_string_value(cells, "C1", "Product")
114+
set_cell_string_value(cells, "D1", "Continent")
115+
set_cell_string_value(cells, "E1", "Country")
116+
set_cell_string_value(cells, "F1", "Sale")
117+
118+
set_cell_string_value(cells, "A2", "David")
119+
set_cell_string_value(cells, "A3", "David")
120+
set_cell_string_value(cells, "A4", "David")
121+
set_cell_string_value(cells, "A5", "David")
122+
set_cell_string_value(cells, "A6", "James")
123+
124+
set_cell_int_value(cells, "B2", 1)
125+
set_cell_int_value(cells, "B3", 2)
126+
set_cell_int_value(cells, "B4", 3)
127+
set_cell_int_value(cells, "B5", 4)
128+
set_cell_int_value(cells, "B6", 1)
129+
130+
set_cell_string_value(cells, "C2", "Maxilaku")
131+
set_cell_string_value(cells, "C3", "Maxilaku")
132+
set_cell_string_value(cells, "C4", "Chai")
133+
set_cell_string_value(cells, "C5", "Maxilaku")
134+
set_cell_string_value(cells, "C6", "Chang")
135+
136+
set_cell_string_value(cells, "D2", "Asia")
137+
set_cell_string_value(cells, "D3", "Asia")
138+
set_cell_string_value(cells, "D4", "Asia")
139+
set_cell_string_value(cells, "D5", "Asia")
140+
set_cell_string_value(cells, "D6", "Europe")
141+
142+
set_cell_string_value(cells, "E2", "China")
143+
set_cell_string_value(cells, "E3", "India")
144+
set_cell_string_value(cells, "E4", "Korea")
145+
set_cell_string_value(cells, "E5", "India")
146+
set_cell_string_value(cells, "E6", "France")
147+
148+
set_cell_int_value(cells, "F2", 2000)
149+
set_cell_int_value(cells, "F3", 500)
150+
set_cell_int_value(cells, "F4", 1200)
151+
set_cell_int_value(cells, "F5", 1500)
152+
set_cell_int_value(cells, "F6", 500)
153+
154+
listObjects, _ := worksheet.GetListObjects()
155+
index, _ := listObjects.Add_String_String_Bool("A1", "F6", true)
156+
listObject, _ := listObjects.Get_Int(index)
157+
listObject.SetShowHeaderRow(true)
158+
listObject.SetTableStyleType(TableStyleType_TableStyleMedium10)
159+
listObject.SetShowTotals(true)
160+
161+
workbook.Save_String("CreateTable.xlsx")
162+
}
163+
```
164+
165+
### Create bubble chart in excel
166+
167+
```go
168+
169+
package main
170+
171+
import (
172+
. github.com/aspose-cells/aspose-cells-go-cpp
173+
)
174+
175+
func main() {
176+
workbook, _ := NewWorkbook()
177+
worksheets, _ := workbook.GetWorksheets()
178+
worksheet, _ := worksheets.Get_Int(0)
179+
cells, _ := worksheet.GetCells()
180+
set_cell_string_value_2(cells, 0, 0, "Values")
181+
set_cell_int_value_2(cells, 0, 1, 2)
182+
set_cell_int_value_2(cells, 0, 2, 4)
183+
set_cell_int_value_2(cells, 0, 3, 6)
184+
185+
set_cell_string_value_2(cells, 1, 0, "Bubble Size")
186+
set_cell_int_value_2(cells, 1, 1, 2)
187+
set_cell_int_value_2(cells, 1, 2, 3)
188+
set_cell_int_value_2(cells, 1, 3, 1)
189+
190+
set_cell_string_value_2(cells, 1, 0, "X Values")
191+
set_cell_int_value_2(cells, 2, 1, 1)
192+
set_cell_int_value_2(cells, 2, 2, 2)
193+
set_cell_int_value_2(cells, 2, 3, 3)
194+
cells.SetColumnWidth(0, 12)
195+
196+
charts, _ := worksheet.GetCharts()
197+
charts.AddFloatingChart(ChartType_Bubble, 5, 0, 20, 8)
198+
chart, _ := charts.Get_Int(0)
199+
nSeries, _ := chart.GetNSeries()
200+
nSeries.Add_String_Bool("B1:D1", true)
201+
series, _ := nSeries.Get(0)
202+
series.SetBubbleSizes("B2:D2")
203+
series.SetXValues("B3:D3")
204+
series.SetValues("B1:D1")
205+
workbook.Save_String("CreateBubbleChart.xlsx")
206+
207+
}
88208

89209
```

0 commit comments

Comments
 (0)