Browse Source

- Included SetIsRightToLeftInXlsx sample project

- Removed and sorted using directives
- Changed .gitignore to ignore NuGet examples\packages folder
pull/22/head
Leniel Macaferi 11 years ago
parent
commit
feab192bad
  1. 5
      .gitignore
  2. 21
      examples/NPOI.XSSF.Examples.2010.sln
  3. 15
      examples/hssf/ConvertExcelToHtml/ConvertExcelToHtml.csproj
  4. 7
      examples/hssf/ConvertExcelToHtml/Program.cs
  5. 1
      examples/hssf/ConvertExcelToHtml/Properties/AssemblyInfo.cs
  6. 5
      examples/hssf/ConvertExcelToHtml/packages.config
  7. 76
      examples/xssf/MeringCellsInXlsx/MergingCellsInXlsx.csproj
  8. 6
      examples/xssf/ScatterChart/Program.cs
  9. 5
      examples/xssf/SetCellValuesInXlsx/SetCellValuesInXlsx.csproj
  10. 39
      examples/xssf/SetIsRightToLeftInXlsx/Program.cs
  11. 36
      examples/xssf/SetIsRightToLeftInXlsx/Properties/AssemblyInfo.cs
  12. 75
      examples/xssf/SetIsRightToLeftInXlsx/SetIsRightToLeftInXlsx.csproj
  13. 3
      examples/xssf/SetIsRightToLeftInXlsx/app.config
  14. 3
      examples/xwpf/CreateEmptyDocument/app.config
  15. 3
      examples/xwpf/SimpleDocument/app.config
  16. 3
      examples/xwpf/SimpleTable/app.config
  17. 3
      examples/xwpf/UpdateEmbeddedDoc/app.config

5
.gitignore

@ -149,4 +149,7 @@ Desktop.ini
$RECYCLE.BIN/
# Mac crap
.DS_Store
.DS_Store
# Examples packages folder
examples/packages

21
examples/NPOI.XSSF.Examples.2010.sln

@ -1,5 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateEmptyWorkbook", "xssf\CreateEmptyWorkbook\CreateEmptyWorkbook.csproj", "{AFBE86E3-EDBE-45B4-8950-8B883102A47F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetCellValuesInXlsx", "xssf\SetCellValuesInXlsx\SetCellValuesInXlsx.csproj", "{D49F896A-A2E1-4C28-ACB7-73FB2910626D}"
@ -56,6 +59,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UseCase", "UseCase", "{2190
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConditionalFormats", "xssf\ConditionalFormats\ConditionalFormats.csproj", "{CFA33A5A-DA93-48BE-B513-6FCDA5447B9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetIsRightToLeftInXlsx", "xssf\SetIsRightToLeftInXlsx\SetIsRightToLeftInXlsx.csproj", "{4D81B9A9-14B6-4506-A7F4-59289886D822}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -326,14 +331,24 @@ Global
{CFA33A5A-DA93-48BE-B513-6FCDA5447B9F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CFA33A5A-DA93-48BE-B513-6FCDA5447B9F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CFA33A5A-DA93-48BE-B513-6FCDA5447B9F}.Release|x86.ActiveCfg = Release|Any CPU
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Debug|Any CPU.ActiveCfg = Debug|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Debug|Mixed Platforms.Build.0 = Debug|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Debug|x86.ActiveCfg = Debug|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Debug|x86.Build.0 = Debug|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Release|Any CPU.ActiveCfg = Release|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Release|Mixed Platforms.ActiveCfg = Release|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Release|Mixed Platforms.Build.0 = Release|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Release|x86.ActiveCfg = Release|x86
{4D81B9A9-14B6-4506-A7F4-59289886D822}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A3103D4C-7334-4B70-9524-E57105EB5E55} = {219097C8-95A0-479C-A713-8D4EB842C2FF}
{ED6DC363-2017-4004-AF44-2AA171709EFC} = {FB96FC42-FB38-4F3B-9BA2-ACE24653CE0D}
{87009589-28B8-4F63-A50D-A0C599E01A1E} = {FB96FC42-FB38-4F3B-9BA2-ACE24653CE0D}
{AAAED0B0-1797-464C-8DF6-96DEBFB57DE7} = {219097C8-95A0-479C-A713-8D4EB842C2FF}
{A3103D4C-7334-4B70-9524-E57105EB5E55} = {219097C8-95A0-479C-A713-8D4EB842C2FF}
EndGlobalSection
EndGlobal

15
examples/hssf/ConvertExcelToHtml/ConvertExcelToHtml.csproj

@ -52,8 +52,20 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\..\packages\NPOI.2.0.6\lib\net20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI">
<HintPath>..\..\..\solution\Lib\NPOI.dll</HintPath>
<HintPath>..\..\packages\NPOI.2.0.6\lib\net20\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML">
<HintPath>..\..\packages\NPOI.2.0.6\lib\net20\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net">
<HintPath>..\..\packages\NPOI.2.0.6\lib\net20\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats">
<HintPath>..\..\packages\NPOI.2.0.6\lib\net20\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@ -67,6 +79,7 @@
<None Include="19599-1.xls">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">

7
examples/hssf/ConvertExcelToHtml/Program.cs

@ -15,11 +15,9 @@
limitations under the License.
==================================================================== */
using System;
using System.Collections.Generic;
using System.Text;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Converter;
using NPOI.HSSF.UserModel;
using System;
using System.IO;
namespace NPOI.Examples.ConvertExcelToHtml
@ -34,7 +32,6 @@ namespace NPOI.Examples.ConvertExcelToHtml
fileName = Path.Combine(Environment.CurrentDirectory, fileName);
workbook = ExcelToHtmlUtils.LoadXls(fileName);
ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter();
//set output parameter

1
examples/hssf/ConvertExcelToHtml/Properties/AssemblyInfo.cs

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ConvertExcelToHtml")]

5
examples/hssf/ConvertExcelToHtml/packages.config

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NPOI" version="2.0.6" targetFramework="net20" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net20" />
</packages>

76
examples/xssf/MeringCellsInXlsx/MergingCellsInXlsx.csproj

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E370B5B7-8679-4FBA-BB7B-EDD035245F03}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MeringCellsInXlsx</RootNamespace>
<AssemblyName>MeringCellsInXlsx</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=1.2.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

6
examples/xssf/ScatterChart/Program.cs

@ -50,10 +50,8 @@ namespace ScatterChart
IChartDataSource<double> ys2 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));
var s1 = data.AddSerie(xs, ys1);
s1.SetTitle("title1");
var s2 = data.AddSerie(xs, ys2);
s2.SetTitle("title2");
data.AddSerie(xs, ys1);
data.AddSerie(xs, ys2);
chart.Plot(data, bottomAxis, leftAxis);
// Write the output to a file

5
examples/xssf/SetCellValuesInXlsx/SetCellValuesInXlsx.csproj

@ -38,9 +38,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=1.2.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.dll</HintPath>
<Reference Include="NPOI">
<HintPath>..\..\..\solution\Lib\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

39
examples/xssf/SetIsRightToLeftInXlsx/Program.cs

@ -0,0 +1,39 @@
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.IO;
namespace NPOI.Examples.XSSF.SetIsRightToLeftInXlsx
{
class Program
{
static void Main(string[] args)
{
IWorkbook workbook = new XSSFWorkbook();
ISheet sheet1 = workbook.CreateSheet("Sheet1");
// Setting support for Right To Left
sheet1.IsRightToLeft = true;
sheet1.CreateRow(0).CreateCell(0).SetCellValue("This is a Sample");
int x = 1;
for(int i = 1; i <= 15; i++)
{
IRow row = sheet1.CreateRow(i);
for(int j = 0; j < 15; j++)
{
row.CreateCell(j).SetCellValue(x++);
}
}
FileStream sw = File.Create("test.xlsx");
workbook.Write(sw);
sw.Close();
}
}
}

36
examples/xssf/SetIsRightToLeftInXlsx/Properties/AssemblyInfo.cs

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SetCellValuesInXlsx")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SetCellValuesInXlsx")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2a0c9f90-bd99-41d7-92a7-026ba2470418")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

75
examples/xssf/SetIsRightToLeftInXlsx/SetIsRightToLeftInXlsx.csproj

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4D81B9A9-14B6-4506-A7F4-59289886D822}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SetIsRightToLeftInXlsx</RootNamespace>
<AssemblyName>SetIsRightToLeftInXlsx</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI">
<HintPath>..\..\..\solution\Lib\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\solution\Lib\.net4\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

3
examples/xssf/SetIsRightToLeftInXlsx/app.config

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

3
examples/xwpf/CreateEmptyDocument/app.config

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

3
examples/xwpf/SimpleDocument/app.config

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

3
examples/xwpf/SimpleTable/app.config

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

3
examples/xwpf/UpdateEmbeddedDoc/app.config

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Loading…
Cancel
Save