Closed claudiofsr closed 7 months ago
I ran the example with and without the changes and got the following:
Without changes.
With changes:
I see that one version has some alignment properties and the other doesn't.
That is probably correct in terms of what is specified in the code. The row format and the table header format are separate. In rust_xlsxwriter
and Excel. The rust_xlsxwriter
library doesn't attempt to apply the row format to the table header because of this separation. (It does however apply the format to cells outside the table.)
In this particular case I think you should be setting the table header and not the row format but it is hard to tell from the description alone.
Let me know what you think.
.set_text_wrap()
doesn't work either.
You could implement the set_header_format(some_format) method in Worksheet and differentiate .set_row_format(row_num, some_format)
from .set_header_format(some_format)
[use excluded for header].
set_header_format would be fully compatible with
header_format = some_format, table_default )].
I don't know if this makes sense to you.
I don't know if this makes sense to you.
Not really. I'm still not sure what the issue is. Do you think you could break this down into a small runnable example that demonstrates the issue.
Instead of just one PathInfo structure, there would be PathInfo1 and PathInfo2, and PathInfo1 would have the format FFF1 and PathInfo2 would have the format FFF2.
Using
worksheet
.set_name(sheet_name)?
.set_row_height(0, 32)?
.set_row_format(0, fmt_header)? // <---
.set_freeze_panes(1, 0)?;
would not be the solution!
Sorry. I still don’t understand what the issue is. Try explain with a reproducible example.
I wanted to create an "excel.rs" file that could be used generically for several different possible structures (PathInfo01, PathInfo02, ... PathInfo0N), with possible different formats.
However, I see that you understand otherwise.
You can close this topic.
Thank you for your attention.
Current behavior
I use rust_xlsxwriter in find-identical-files.
If
I comment out line 98 of the excel.rs file [.set_row_format(0, fmt_header)?]
and
I uncomment line 17 of the path_info.rs file [header_format = get_xlsx_format("header")],
the header format is changed.
To verify:
See the XLSX file "fif.xlsx" with and without the changes.
Expected behavior
I hope
the header_format and table_default options are compatible and
.set_row_format(0, fmt_header)?
is not necessary.