You've already forked lazarus-ccr
fpspreadsheet: Add demo with frozen columns and rows in a worksheet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8704 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<MainUnitHasScaledStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="demo_frozen_rows_cols"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<RequiredPackages>
|
||||
<Item>
|
||||
<PackageName Value="laz_fpspreadsheet"/>
|
||||
</Item>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="demo_frozen_rows_cols.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="demo_frozen_rows_cols"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf3"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@ -0,0 +1,30 @@
|
||||
program demo_frozen_rows_cols;
|
||||
uses
|
||||
SysUtils,
|
||||
FPSpreadsheet, fpsTypes, xlsxOOXML;
|
||||
var
|
||||
wb: TsWorkbook;
|
||||
ws: TsWorksheet;
|
||||
r, c: Integer;
|
||||
begin
|
||||
wb := TsWorkbook.Create;
|
||||
try
|
||||
ws := wb.AddWorksheet('Sheet1');
|
||||
|
||||
// Fill worksheet with some data
|
||||
for r := 0 to 100 do
|
||||
for c := 0 to 10 do
|
||||
ws.WriteText(r, c, Format('R%d C%d', [r, c]));
|
||||
|
||||
// Prepare frozen columns and frozen rows
|
||||
ws.LeftPaneWidth := 1; // There should be 1 frozen column
|
||||
ws.TopPaneHeight := 2; // There should be 2 frozen rows
|
||||
ws.Options := ws.Options + [soHasFrozenPanes]; // Activate this feature.
|
||||
|
||||
// Save to file
|
||||
wb.WriteToFile('test.xlsx', true);
|
||||
finally
|
||||
wb.Free;
|
||||
end;
|
||||
end.
|
||||
|
@ -93,6 +93,11 @@
|
||||
<Mode Name="Default"/>
|
||||
</BuildModes>
|
||||
</Target>
|
||||
<Target FileName="frozen_rows_cols\demo_frozen_rows_cols.lpi">
|
||||
<BuildModes>
|
||||
<Mode Name="Default"/>
|
||||
</BuildModes>
|
||||
</Target>
|
||||
</Targets>
|
||||
</ProjectGroup>
|
||||
</CONFIG>
|
||||
|
@ -11,6 +11,9 @@ This folder contains various demo applications:
|
||||
- expression_parser_demo_expression_parser: shows how the formula engine of
|
||||
FPSpreadsheet is used.
|
||||
|
||||
- frozen_rowscols/demo_frozen_cols_rows: shows how the first rows and columns
|
||||
can be "frozen", i.e. prevented from scrolling.
|
||||
|
||||
- header_footer_images/demo_write_headerfooter_images: adds images to
|
||||
worksheet headers and footers
|
||||
|
||||
|
@ -2,6 +2,7 @@ cell_formats\demo_write_formatting -quit
|
||||
colors\demo_write_colors -quit
|
||||
conditional_formatting\demo_conditional_formatting -quit
|
||||
expression_parser\demo_expression_parser -quit
|
||||
frozen_rowscols\demo_frozen_rows_cols -quit
|
||||
header_footer_images\demo_write_headerfooter_images -quit
|
||||
hyperlinkdemo\collectlinks -quit
|
||||
ignore_formulas\demo_ignore_formula -quit
|
||||
|
Reference in New Issue
Block a user