Comments (5)
I do it for every sheet directly before saving the file and it works fine.
Pass the amount of rows and columns you want to lock!
So in your case (1,2)
sheet1.freeze_panes(1, 1);
sheet2.freeze_panes(1, 1);
sheet3.freeze_panes(1, 1);
if excel.close().is_ok() {...}
from xlsxwriter-rs.
Hmmmm... well, I'm certainly open to being wrong. Suppose I'll tinker a bit more, there's probably something I've missed then. Thanks for the sanity check!
from xlsxwriter-rs.
If you post some code that refuses to work I might be able to help out more.
from xlsxwriter-rs.
It should work as expected. The only thing to look out for is to make sure that splitting cell is after the split, like in Excel.
I need to freeze the header (row 0) and the first two columns (columns 0 and 1).
In that case you would need to split at row = 1 and column = 2. This is still zero indexing but the split needs to be specified in the bottom right quadrant instead of the top left. Here is an example.
So Here is an example:
use xlsxwriter::Workbook;
fn main() -> Result<(), xlsxwriter::XlsxError> {
let workbook = Workbook::new("freeze.xlsx");
let mut worksheet = workbook.add_worksheet(None)?;
for row in 0_u32..10_u32 {
for col in 0_u16..8_u16 {
worksheet.write_string(row, col, "Text", None)?;
}
}
worksheet.freeze_panes(1, 2);
workbook.close()
}
Output:
I'd suggest closing this issue.
from xlsxwriter-rs.
Thanks!
from xlsxwriter-rs.
Related Issues (20)
- Linker error: z_errmsg already defined -> Depend on flate2? HOT 2
- compile error
- Debug trait for format enums HOT 1
- Non-ASCII path xlsx file creation failed (Windows) HOT 2
- Data validation booleans are inverted HOT 1
- v0.4.0 fails to compile, possibly on arm-based (aarch64) mac
- Invalid xlsx files generated with some locales
- [security] write_string panics upon null byte injection attempts HOT 1
- Compile failed of v0.5.0 on ARM Mac Osx HOT 1
- would it make more sense to make (row, col) a tuple in all function signatures
- call sheet.data_validation_cell crash HOT 3
- Make DataValidationType a data-bound enum HOT 3
- Not able to export the huge data (more than 32767 characters) HOT 2
- Change ErrorAlert and InputMessage to builder pattern
- New release of libxlsxwriter-sys? HOT 2
- Will this repository get a long term support? HOT 2
- Compilation failure with outdated `libxlsxwriter_sys` HOT 2
- Color fine alpha management HOT 1
- Paste a link with text alt in a cell HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlsxwriter-rs.