本文整理汇总了C++中workbook_close函数的典型用法代码示例。如果您正苦于以下问题:C++ workbook_close函数的具体用法?C++ workbook_close怎么用?C++ workbook_close使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了workbook_close函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_axis25.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_COLUMN);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 47471232;
chart->axis_id_2 = 48509696;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_add_series(chart, NULL, "=Sheet1!$B$1:$B$5");
chart_add_series(chart, NULL, "=Sheet1!$C$1:$C$5");
chart_axis_set_num_format(chart->x_axis, "[$¥-411]#,##0.00");
chart_axis_set_num_format(chart->y_axis, "0.00%");
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例2: main
int main() {
lxw_workbook *workbook = workbook_new("test_format51.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_format *format;
double value = 123.456;
worksheet_set_column(worksheet, 0, 0, 12, NULL);
format = workbook_add_format(workbook);
format_set_num_format(format, "0.0");
worksheet_write_number(worksheet, 0, 0, value, format);
format = workbook_add_format(workbook);
format_set_num_format(format, "0.000");
worksheet_write_number(worksheet, 1, 0, value, format);
format = workbook_add_format(workbook);
format_set_num_format(format, "0.0000");
worksheet_write_number(worksheet, 2, 0, value, format);
format = workbook_add_format(workbook);
format_set_num_format(format, "0.00000");
worksheet_write_number(worksheet, 3, 0, value, format);
return workbook_close(workbook);
}
示例3: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_legend03.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_LINE);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 93548928;
chart->axis_id_2 = 93550464;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_add_series(chart, NULL, "=Sheet1!$B$1:$B$5");
chart_add_series(chart, NULL, "=Sheet1!$C$1:$C$5");
chart_legend_set_position(chart, LXW_CHART_LEGEND_TOP_RIGHT);
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例4: main
int main() {
lxw_workbook *workbook = new_workbook("test_format02.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_format *format1 = workbook_add_format(workbook);
lxw_format *format2 = workbook_add_format(workbook);
worksheet_set_row(worksheet, 0, 30, NULL, NULL);
format_set_font_name(format1, "Arial");
format_set_bold(format1);
format_set_align(format1, LXW_ALIGN_LEFT);
format_set_align(format1, LXW_ALIGN_VERTICAL_BOTTOM);
format_set_font_name(format2, "Arial");
format_set_bold(format2);
format_set_rotation(format2, 90);
format_set_align(format2, LXW_ALIGN_CENTER);
format_set_align(format2, LXW_ALIGN_VERTICAL_BOTTOM);
worksheet_write_string(worksheet, 0, 0, "Foo", format1);
worksheet_write_string(worksheet, 0, 1, "Bar", format2);
return workbook_close(workbook);
}
示例5: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_size01.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_COLUMN);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 61355904;
chart->axis_id_2 = 61365248;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_add_series(chart, NULL, "=Sheet1!$B$1:$B$5");
chart_add_series(chart, NULL, "=Sheet1!$C$1:$C$5");
lxw_image_options options = {.x_scale = 1.06666667, .y_scale = 1.11111112};
worksheet_insert_chart_opt(worksheet, CELL("E9"), chart, &options);
return workbook_close(workbook);
}
示例6: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_display_units11.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_COLUMN);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 69559424;
chart->axis_id_2 = 69560960;
worksheet_write_number(worksheet, 0, 0, 10000000, NULL);
worksheet_write_number(worksheet, 1, 0, 20000000, NULL);
worksheet_write_number(worksheet, 2, 0, 30000000, NULL);
worksheet_write_number(worksheet, 3, 0, 20000000, NULL);
worksheet_write_number(worksheet, 4, 0, 10000000, NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_axis_set_display_units(chart->y_axis, LXW_CHART_AXIS_UNITS_HUNDREDS);
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例7: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_blank03.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_LINE);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 44253568;
chart->axis_id_2 = 44269952;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_add_series(chart, NULL, "=Sheet1!$B$1:$B$5");
chart_add_series(chart, NULL, "=Sheet1!$C$1:$C$5");
chart_show_blanks_as(chart, LXW_CHART_BLANKS_AS_CONNECTED);
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例8: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_format19.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_COLUMN_STACKED);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 56127488;
chart->axis_id_2 = 57455360;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart, NULL, "=Sheet1!$A$1:$A$5");
chart_add_series(chart, NULL, "=Sheet1!$B$1:$B$5");
lxw_chart_series *series = chart_add_series(chart, NULL, "=Sheet1!$C$1:$C$5");
chart_series_set_labels(series);
chart_series_set_labels_position(series, LXW_CHART_LABEL_POSITION_INSIDE_BASE);
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例9: main
int main() {
/* Create a new workbook and add a worksheet. */
lxw_workbook *workbook = workbook_new("hide_row_col.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_row_t row;
/* Write some data. */
worksheet_write_string(worksheet, 0, 3, "Some hidden columns.", NULL);
worksheet_write_string(worksheet, 7, 0, "Some hidden rows.", NULL);
/* Hide all rows without data. */
worksheet_set_default_row(worksheet, 15, LXW_TRUE);
/* Set the height of empty rows that we do want to display even if it is */
/* the default height. */
for (row = 1; row <= 6; row++)
worksheet_set_row(worksheet, row, 15, NULL);
/* Columns can be hidden explicitly. This doesn't increase the file size. */
lxw_row_col_options options = {.hidden = 1};
worksheet_set_column_opt(worksheet, COLS("G:XFD"), 8.43, NULL, &options);
workbook_close(workbook);
return 0;
}
示例10: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_bar02.xlsx");
lxw_worksheet *worksheet1 = workbook_add_worksheet(workbook, NULL);
lxw_worksheet *worksheet2 = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_BAR);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 93218304;
chart->axis_id_2 = 93219840;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet2, row, col, data[row][col] , NULL);
worksheet_write_string(worksheet1, CELL("A1"), "Foo" , NULL);
chart_add_series(chart, "Sheet2!$A$1:$A$5", "Sheet2!$B$1:$B$5");
chart_add_series(chart, "Sheet2!$A$1:$A$5", "Sheet2!$C$1:$C$5");
worksheet_insert_chart(worksheet2, CELL("E9"), chart);
return workbook_close(workbook);
}
示例11: main
int main() {
lxw_row_t row;
lxw_col_t col;
lxw_row_t max_row = 1000;
lxw_col_t max_col = 50;
// 1
lxw_workbook *workbook;
lxw_worksheet *worksheet;
/* Set the worksheet options. */
lxw_workbook_options options;
options.constant_memory = 1;
/* Create a new workbook with options. */
// 1
workbook = workbook_new_opt("constant_memory.xlsx", &options);
worksheet = workbook_add_worksheet(workbook, NULL);
for (row = 0; row < max_row; row++) {
for (col = 0; col < max_col; col++) {
worksheet_write_number(worksheet, row, col, 123.45, NULL);
}
}
return workbook_close(workbook);
}
示例12: main
int main() {
lxw_workbook *workbook = workbook_new("test_format09.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_format *border1 = workbook_add_format(workbook);
lxw_format *border2 = workbook_add_format(workbook);
lxw_format *border3 = workbook_add_format(workbook);
lxw_format *border4 = workbook_add_format(workbook);
format_set_border (border1, LXW_BORDER_HAIR);
format_set_border_color(border1, LXW_COLOR_RED);
format_set_diag_type (border2, LXW_DIAGONAL_BORDER_UP);
format_set_diag_color(border2, LXW_COLOR_RED);
format_set_diag_type (border3, LXW_DIAGONAL_BORDER_DOWN);
format_set_diag_color(border3, LXW_COLOR_RED);
format_set_diag_type (border4, LXW_DIAGONAL_BORDER_UP_DOWN);
format_set_diag_color(border4, LXW_COLOR_RED);
worksheet_write_blank(worksheet, 1, 1, border1);
worksheet_write_blank(worksheet, 3, 1, border2);
worksheet_write_blank(worksheet, 5, 1, border3);
worksheet_write_blank(worksheet, 7, 1, border4);
return workbook_close(workbook);
}
示例13: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_doughnut02.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_DOUGHNUT);
uint8_t data[3][2] = {
{2, 60},
{4, 30},
{6, 10},
};
int row, col;
for (row = 0; row < 3; row++)
for (col = 0; col < 2; col++)
worksheet_write_number(worksheet, row, col, data[row][col], NULL);
chart_add_series(chart,
"=Sheet1!$A$1:$A$3",
"=Sheet1!$B$1:$B$3"
);
chart_set_hole_size(chart, 10);
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}
示例14: main
int main() {
lxw_workbook *workbook = workbook_new("test_format08.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
lxw_format *border1 = workbook_add_format(workbook);
lxw_format *border2 = workbook_add_format(workbook);
lxw_format *border3 = workbook_add_format(workbook);
lxw_format *border4 = workbook_add_format(workbook);
lxw_format *border5 = workbook_add_format(workbook);
format_set_bottom(border1, LXW_BORDER_THIN);
format_set_bottom_color(border1, LXW_COLOR_RED);
format_set_top(border2, LXW_BORDER_THIN);
format_set_top_color(border2, LXW_COLOR_RED);
format_set_left(border3, LXW_BORDER_THIN);
format_set_left_color(border3, LXW_COLOR_RED);
format_set_right(border4, LXW_BORDER_THIN);
format_set_right_color(border4, LXW_COLOR_RED);
format_set_border(border5, LXW_BORDER_THIN);
format_set_border_color(border5, LXW_COLOR_RED);
worksheet_write_blank(worksheet, 1, 1, border1);
worksheet_write_blank(worksheet, 3, 1, border2);
worksheet_write_blank(worksheet, 5, 1, border3);
worksheet_write_blank(worksheet, 7, 1, border4);
worksheet_write_blank(worksheet, 9, 1, border5);
return workbook_close(workbook);
}
示例15: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_column05.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, "Foo");
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_COLUMN);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 47292800;
chart->axis_id_2 = 47295104;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet, row, col, data[row][col] , NULL);
chart_add_series(chart, NULL, "=Foo!$A$1:$A$5");
chart_add_series(chart, NULL, "=Foo!$B$1:$B$5");
chart_add_series(chart, NULL, "=Foo!$C$1:$C$5");
worksheet_insert_chart(worksheet, CELL("E9"), chart);
return workbook_close(workbook);
}