mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Update sample1.cpp so it will compile
This commit is contained in:
parent
2831b25f09
commit
be412599ba
|
@ -1,15 +1,17 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <xlnt/xlnt.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
for(auto sheet : xlnt::load_workbook("book.xlsx"))
|
for(auto sheet : xlnt::reader::load_workbook("book.xlsx"))
|
||||||
{
|
{
|
||||||
std::cout << sheet.get_title() << ": " << std::endl;
|
std::cout << sheet.get_title() << ": " << std::endl;
|
||||||
|
|
||||||
for(auto row : sheet)
|
for(auto row : sheet.rows())
|
||||||
{
|
{
|
||||||
for(auto cell : row)
|
for(auto cell : row)
|
||||||
{
|
{
|
||||||
std::cout << cell << ", ";
|
std::cout << cell.get_value().as<std::string>() << ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
@ -26,7 +28,7 @@ int main()
|
||||||
{
|
{
|
||||||
for(int column = 0; column < 1000; column++)
|
for(int column = 0; column < 1000; column++)
|
||||||
{
|
{
|
||||||
sheet[xlnt::cell_reference(column, row)] = row * 1000 + column;
|
sheet[xlnt::cell_reference(column, row)].set_value(row * 1000 + column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user