Skip to content

Commit f4b9770

Browse files
authored
Merge pull request #198 from SyncfusionExamples/947645-AutofillExample
947645-Need to update the details about Auto fill option in the UG documentation
2 parents ac6737c + 5fbb85f commit f4b9770

File tree

20 files changed

+529
-0
lines changed

20 files changed

+529
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36127.28 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoFillUsingFillSeries", "AutoFillUsingFillSeries\AutoFillUsingFillSeries.csproj", "{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {E8F6A654-22D2-4935-986C-BC1CF1D5487F}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj" />
12+
<ProjectReference Include="..\..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Output/.gitkeep

Whitespace-only changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Syncfusion.XlsIO;
2+
3+
4+
namespace AutoFillUsingFillSeries
5+
{
6+
class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
using (ExcelEngine excelEngine = new ExcelEngine())
11+
{
12+
IApplication application = excelEngine.Excel;
13+
application.DefaultVersion = ExcelVersion.Xlsx;
14+
IWorkbook workbook = application.Workbooks.Create(1);
15+
IWorksheet worksheet = workbook.Worksheets[0];
16+
17+
//Assign values to the cells
18+
worksheet["A1"].Number = 2;
19+
worksheet["A2"].Number = 4;
20+
worksheet["A3"].Number = 6;
21+
22+
//Define the source range
23+
IRange source = worksheet["A1:A3"];
24+
25+
//Define the destination range
26+
IRange destinationRange = worksheet["A4:A100"];
27+
28+
//Auto fill using the series option
29+
source.AutoFill(destinationRange, ExcelAutoFillType.FillSeries);
30+
31+
//Saving the workbook
32+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write);
33+
workbook.SaveAs(outputStream);
34+
35+
//Dispose streams
36+
outputStream.Dispose();
37+
}
38+
}
39+
}
40+
}
41+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# How to auto fill a series in a worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
11+
```csharp
12+
using System;
13+
using System.IO;
14+
using Syncfusion.XlsIO;
15+
```
16+
17+
Step 5: Include the below code snippet in **Program.cs** to auto fill a series in a worksheet.
18+
19+
```csharp
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
IWorkbook workbook = application.Workbooks.Create(1);
25+
IWorksheet worksheet = workbook.Worksheets[0];
26+
27+
//Assign values to the cells
28+
worksheet["A1"].Number = 2;
29+
worksheet["A2"].Number = 4;
30+
worksheet["A3"].Number = 6;
31+
32+
//Define the source range
33+
IRange source = worksheet["A1:A3"];
34+
35+
//Define the destination range
36+
IRange destinationRange = worksheet["A4:A100"];
37+
38+
//Auto fill using the series option
39+
source.AutoFill(destinationRange, ExcelAutoFillType.FillSeries);
40+
41+
//Saving the workbook
42+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write);
43+
workbook.SaveAs(outputStream);
44+
45+
//Dispose streams
46+
outputStream.Dispose();
47+
}
48+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36127.28 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DateTimeFillSeries", "DateTimeFillSeries\DateTimeFillSeries.csproj", "{346AE701-4612-43C5-AD9A-3E2789A1CD32}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{346AE701-4612-43C5-AD9A-3E2789A1CD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{346AE701-4612-43C5-AD9A-3E2789A1CD32}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{346AE701-4612-43C5-AD9A-3E2789A1CD32}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{346AE701-4612-43C5-AD9A-3E2789A1CD32}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {80FA51BF-09BC-42BE-8C5F-1A1D2108B0DE}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj" />
12+
<ProjectReference Include="..\..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Output/.gitkeep

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Syncfusion.XlsIO;
2+
3+
namespace DateTimeFillSeries
4+
{
5+
class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
using (ExcelEngine excelEngine = new ExcelEngine())
10+
{
11+
IApplication application = excelEngine.Excel;
12+
application.DefaultVersion = ExcelVersion.Xlsx;
13+
IWorkbook workbook = application.Workbooks.Create(1);
14+
IWorksheet worksheet = workbook.Worksheets[0];
15+
16+
//Assign datetime value to the cell
17+
worksheet["A1"].DateTime = new DateTime(2025, 1, 1);
18+
19+
//Define the range
20+
IRange range = worksheet["A1:A50"];
21+
22+
//Fill series using the years option, step value and stop value
23+
range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Years, 2, new DateTime(2100, 1, 1));
24+
25+
//Saving the workbook
26+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write);
27+
workbook.SaveAs(outputStream);
28+
29+
//Dispose streams
30+
outputStream.Dispose();
31+
}
32+
}
33+
}
34+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# How to fill a date series in a worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
11+
```csharp
12+
using System;
13+
using System.IO;
14+
using Syncfusion.XlsIO;
15+
```
16+
17+
Step 5: Include the below code snippet in **Program.cs** to fill a date series in a worksheet.
18+
```csharp
19+
using (ExcelEngine excelEngine = new ExcelEngine())
20+
{
21+
IApplication application = excelEngine.Excel;
22+
application.DefaultVersion = ExcelVersion.Xlsx;
23+
IWorkbook workbook = application.Workbooks.Create(1);
24+
IWorksheet worksheet = workbook.Worksheets[0];
25+
26+
//Assign datetime value to the cell
27+
worksheet["A1"].DateTime = new DateTime(2025, 1, 1);
28+
29+
//Define the range
30+
IRange range = worksheet["A1:A50"];
31+
32+
//Fill series using the years option
33+
range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Years, 2, new DateTime(2100, 1, 1));
34+
35+
//Saving the workbook
36+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write);
37+
workbook.SaveAs(outputStream);
38+
39+
//Dispose streams
40+
outputStream.Dispose();
41+
}
42+
```

0 commit comments

Comments
 (0)