Skip to content

Commit 5207633

Browse files
Merge branch 'master' into BLAZ-30173-orc-mas
2 parents 71fb023 + 519d2b8 commit 5207633

File tree

9 files changed

+142
-15
lines changed

9 files changed

+142
-15
lines changed

Javascript/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# How to bind Oracle database to a Pivot Table
22

3-
A quick start project for connecting a Oracle database to a Syncfusion Pivot Table. This repository includes a Web API Controller (PivotController) for retrieving data from a Oracle database, as well as a quick start sample for the JavaScript platform that displays the retrieved data in a Pivot Table.
4-
5-
**Documentation:** https://ej2.syncfusion.com/javascript/documentation/pivotview/getting-started/
3+
A quick start project for connecting a Oracle database to a Syncfusion Pivot Table. This repository includes a Web API Controller ([MyWebService](../MyWebService/)) for retrieving data from a Oracle database, as well as a quick start sample in the JavaScript platform that displays the retrieved data in a Syncfusion Pivot Table.
64

75
## Project prerequisites
86

@@ -11,10 +9,10 @@ Before beginning work on the server and client projects, ensure the following so
119
* [git](https://git-scm.com/downloads)
1210
* [Node.js](https://nodejs.org/en/)
1311
* [Visual Studio Code](https://code.visualstudio.com/)
14-
* Compatible versions of [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/ ) and [.NET Core SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or later installed on your machine
12+
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/ ) and [.NET Core SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or later installed on your machine
1513

1614
## How to run this application?
1715

18-
* To run this application, clone the `how-to-bind-Oracle-database-to-pivot-table` repository and then open **PivotController** in Visual Studio 2022. Simply build and run your project in IIS Express, and it will host and display the URL `https://localhost:7029`.
16+
* To run this application, clone the [how-to-bind-Oracle-database-to-pivot-table](https://github.com/SyncfusionExamples/how-to-bind-Oracle-database-to-pivot-table) repository and then open **MyWebService** project in Visual Studio 2022. Simply build and run your project in IIS Express, and it will host and display the URL `https://localhost:44346/`.
1917

20-
* Now open JavaScript sample in Visual Studio Code and Initialize the Pivot Table, map the hosted URL, prepare and add a pivot report, and finally, open the 'index.html' file in your browser to run your project.
18+
* Now open the JavaScript sample in Visual Studio Code. Initialize the Pivot Table, map the hosted URL, create a pivot report, and finally, open the **index.html** file in your browser to run your project.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Newtonsoft.Json;
3+
using Oracle.ManagedDataAccess.Client;
4+
using System.Data;
5+
6+
namespace PivotController.Controllers
7+
{
8+
[ApiController]
9+
[Route("[controller]")]
10+
public class PivotController : ControllerBase
11+
{
12+
[HttpGet(Name = "GetOracleResult")]
13+
public object Get()
14+
{
15+
return JsonConvert.SerializeObject(FetchOracleResult());
16+
}
17+
18+
private static DataTable FetchOracleResult()
19+
{
20+
string connectionString = "<Enter your valid connection string here>";
21+
OracleConnection oracleConnection = new OracleConnection(connectionString);
22+
oracleConnection.Open();
23+
OracleCommand command = new OracleCommand("SELECT * FROM EMPLOYEES", oracleConnection);
24+
OracleDataAdapter dataAdapter = new OracleDataAdapter(command);
25+
DataTable dataTable = new DataTable();
26+
dataAdapter.Fill(dataTable);
27+
oracleConnection.Close();
28+
return dataTable;
29+
}
30+
}
31+
}

MyWebService/MyWebService.csproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
11+
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.80" />
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
13+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
14+
</ItemGroup>
15+
16+
</Project>

MyWebService/Program.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var builder = WebApplication.CreateBuilder(args);
2+
3+
// Add services to the container.
4+
5+
builder.Services.AddControllers();
6+
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
7+
builder.Services.AddEndpointsApiExplorer();
8+
builder.Services.AddSwaggerGen();
9+
10+
builder.Services.AddCors(options =>
11+
{
12+
options.AddPolicy("CorsPolicy",
13+
builder => builder.AllowAnyOrigin()
14+
.AllowAnyMethod()
15+
.AllowAnyHeader());
16+
});
17+
18+
var app = builder.Build();
19+
20+
// Configure the HTTP request pipeline.
21+
if (app.Environment.IsDevelopment())
22+
{
23+
app.UseSwagger();
24+
app.UseSwaggerUI();
25+
}
26+
27+
app.UseHttpsRedirection();
28+
29+
app.UseAuthorization();
30+
31+
app.MapControllers();
32+
33+
app.UseCors("CorsPolicy");
34+
35+
app.Run();
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:6199",
8+
"sslPort": 44346
9+
}
10+
},
11+
"profiles": {
12+
"PivotController": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"launchUrl": "swagger",
17+
"applicationUrl": "https://localhost:7029;http://localhost:5254",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
},
22+
"IIS Express": {
23+
"commandName": "IISExpress",
24+
"launchBrowser": true,
25+
"launchUrl": "swagger",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
}
30+
}
31+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

MyWebService/appsettings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# how-to-bind-Oracle-database-to-pivot-table
2-
A quick start project that shows how to bind Oracle database to the Syncfusion pivot table.
1+
# How to bind Oracle database to a Pivot Table
2+
3+
A quick start project for connecting a Oracle database to a Syncfusion Pivot Table. This repository includes a Web API Controller ([MyWebService](./MyWebService/)) for retrieving data from a Oracle database, as well as a quick start samples in the [TypeScript](./Typescript/) and [JavaScript](./Javascript/) platforms that display the retrieved data in a Syncfusion Pivot Table.

Typescript/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# How to bind Oracle database to a Pivot Table
22

3-
A quick start project for connecting a Oracle database to a Syncfusion Pivot Table. This repository includes a Web API Controller (PivotController) for retrieving data from a Oracle database, as well as a quick start sample for the TypeScript platform that displays the retrieved data in a Pivot Table.
4-
5-
**Documentation:** https://ej2.syncfusion.com/documentation/pivotview/getting-started/
3+
A quick start project for connecting a Oracle database to a Syncfusion Pivot Table. This repository includes a Web API Controller ([MyWebService](../MyWebService/)) for retrieving data from a Oracle database, as well as a quick start sample in the TypeScript platform that displays the retrieved data in a Syncfusion Pivot Table.
64

75
## Project prerequisites
86

@@ -12,19 +10,19 @@ Before beginning work on the server and client projects, ensure the following so
1210
* [Node.js](https://nodejs.org/en/)
1311
* [TypeScript](https://www.typescriptlang.org/)
1412
* [Visual Studio Code](https://code.visualstudio.com/)
15-
* Compatible versions of [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/ ) and [.NET Core SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or later installed on your machine
13+
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/ ) and [.NET Core SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or later installed on your machine
1614

1715
## How to run this application?
1816

19-
* To run this application, clone the `how-to-bind-Oracle-database-to-pivot-table` repository and then open **PivotController** in Visual Studio 2022. Simply build and run your project in IIS Express, and it will host and display the URL `https://localhost:7029`.
17+
* To run this application, clone the [how-to-bind-Oracle-database-to-pivot-table](https://github.com/SyncfusionExamples/how-to-bind-Oracle-database-to-pivot-table) repository and then open **MyWebService** project in Visual Studio 2022. Simply build and run your project in IIS Express, and it will host and display the URL `https://localhost:44346/`.
2018

21-
* Now open TypeScript sample in Visual Studio Code and and install the necessary npm packages using the following command.
19+
* Now open TypeScript sample in Visual Studio Code and install the necessary npm packages using the following command.
2220

2321
```sh
2422
npm install
2523
```
2624

27-
* Initialize the Pivot Table, map the hosted URL, prepare and add a pivot report, and finally run your project using the following command to achieve the desired result.
25+
* Initialize the Pivot Table, map the hosted URL, create a pivot report, and finally run your project using the following command to achieve the desired result.
2826

2927
```sh
3028
npm run start

0 commit comments

Comments
 (0)