How to apply a created font format to a cell?
Posted: Mon May 17, 2010 5:29 pm
Since we've upgraded from XLS2 to XLS4, a lot of code syntax was "broken" by the upgrade because of so many changes. I'm very surprised no backwards compatibility!
Anyways, with XLS2, you can create a new font, assign it an index and then output your string using that newly created font as such:
with ReportSheet.Formats.Add do begin
ReportSheet.Fonts[FontIndex].Name := 'Arial';
ReportSheet.Fonts[FontIndex].Style := [xfsBold];
// Save Format index
FI := Index;
end;
// Use correct format index
ReportSheet.Sheets[0].WriteString(0,AdminRow,FI,'Full Match');
This doesn't work at all in XLS4 when you want to do the output WriteString. I can't figure for the life of me to get this to work in XLS4.
Anyways, with XLS2, you can create a new font, assign it an index and then output your string using that newly created font as such:
with ReportSheet.Formats.Add do begin
ReportSheet.Fonts[FontIndex].Name := 'Arial';
ReportSheet.Fonts[FontIndex].Style := [xfsBold];
// Save Format index
FI := Index;
end;
// Use correct format index
ReportSheet.Sheets[0].WriteString(0,AdminRow,FI,'Full Match');
This doesn't work at all in XLS4 when you want to do the output WriteString. I can't figure for the life of me to get this to work in XLS4.