I'm trying to fill an AdvGridWorkbook with steps describe here:
My code:
xls := TExcelFile.Create; //created once
....
if FileOpenDialog1.Execute then
begin
xls.Open(CurrentExcelFilename);
xls.ConvertFormulasToValues(false, true);
AdvGridExcelImport1.Import(xls);
end;
With AdvGridExcelImport, when using an AdvGridWorkbook, no data will be displayed.
If I replace my AdvGridWorkbook with an AdvGrid, grid is correctly filled
Is there any existing issue when working with AdvGridWorkbook ?
And it seems to be working as expected. Can you find a way to modify it so it shows your problem, or maybe send me a different app with the issue to adrian@tmssoftware.com?
Hi,
There is no direct way that I know of to do that directly, (but I am no expert in AdvStringGrid, maybe there is a property out there that I am not aware of).
But personally, I would just fill the cells directly. You could add this code to the app:
for var i := 0 to AdvGridWorkbook1.Sheets.Count - 1 do
begin
AdvGridWorkbook1.ActiveSheet := i;
for var row := 1 to AdvGridWorkbook1.Grid.RowCount - 1 do
begin
AdvGridWorkbook1.Grid.Cells[0, row] := IntToStr(row);
end;
for var col := 1 to AdvGridWorkbook1.Grid.ColCount - 1 do
begin
AdvGridWorkbook1.Grid.Cells[col, 0] := TCellAddress.EncodeColumn(col);
end;
end;