Page 1 of 1

Freeze panes

Posted: Fri Oct 05, 2012 11:39 am
by mdonath
Is there an opportunity to freeze panes in an Excel sheet using TXLSReadWriteII4?

Markus

Re: Freeze panes

Posted: Mon Oct 08, 2012 8:39 am
by mdonath
Maybe nobody knows what I was asking for. In Excel you can freeze panes here:

https://www.dropbox.com/s/alcvvcj58ii3x ... ePanes.PNG


Markus

Re: Freeze panes

Posted: Mon Oct 08, 2012 3:55 pm
by Joe Griffin
I think what you want is (something like) ...

Code: Select all

  // Fix the top rows for scrolling
  CurrentSheet.Pane.PaneType := ptFrozen;
  CurrentSheet.Pane.SplitColX := 1;
  CurrentSheet.Pane.SplitRowY := 4;
  CurrentSheet.Pane.LeftCol := 1;
  CurrentSheet.Pane.TopRow := 4;
Hope that helps

Re: Freeze panes

Posted: Tue Oct 09, 2012 7:11 am
by mdonath
Sounds good, but causes nothing.
Is the something necessary to apply these changes?

Markus

Re: Freeze panes

Posted: Tue Oct 09, 2012 3:34 pm
by DrTob
You have to add soFrozenPanes to the sheet options:

Code: Select all

CurrentSheet.Options := CurrentSheet.Options + [soFrozenPanes];

Re: Freeze panes

Posted: Wed Oct 10, 2012 12:48 pm
by mdonath
Ok, I did this (RADStudio 2010, C++ Builder):

Code: Select all

	XLSReadWriteII41->Version = xvExcel2007;
	XLSReadWriteII41->Sheets->Items[0]->Options = XLSReadWriteII41->Sheets->Items[0]->Options << soFrozenPanes;
	XLSReadWriteII41->Filename = L"test.xlsx";
	for(int i=0; i<=10; i++)
		for(int j=0; j<=10; j++)
			XLSReadWriteII41->Sheets->Items[0]->AsString[i][j] = L"Test[" + IntToStr(i) + L";" + IntToStr(j) + L"]";
	XLSReadWriteII41->Sheets->Items[0]->Pane->PaneType = ptFrozen;
	XLSReadWriteII41->Sheets->Items[0]->Pane->SplitColX = 1;
	XLSReadWriteII41->Sheets->Items[0]->Pane->SplitRowY = 4;
	XLSReadWriteII41->Sheets->Items[0]->Pane->LeftCol = 1;
	XLSReadWriteII41->Sheets->Items[0]->Pane->TopRow = 4;
	XLSReadWriteII41->Write();
But unfortunately there is no frozen pane in the result file.

Re: Freeze panes

Posted: Thu Oct 11, 2012 4:22 pm
by DrTob
axolot.com/components/xlsrwii20.htm wrote:The support for Excel 2007 files is right now limited to read/write cell values and formatting.