Skip to content

ignatandrei/RSCG_WebAPIExports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSCG_WebAPIExports

RSCG_WebAPIExports

Add exports to file to WebAPI ( for the moment, just Excel / xlsx)

How to use in WebAPI project

Add reference to the package in the .csproj

<PackageReference Include="RSCG_WebAPIExports" Version="2025.8.310.2000" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> <!-- <PackageReference Include="RSCG_WebAPIExports" Version="2025.8.310.2000" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> <PackageReference Include="ArrayToExcel" Version="2.2.2" /> -->

or

<PackageReference Include="RSCG_WebAPIExports" Version="2025.8.310.2000" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> <!-- <PackageReference Include="RSCG_WebAPIExports" Version="2025.8.310.2000" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> <PackageReference Include="ArrayToExcel" Version="2.2.2" /> -->

Then in the WebAPI add

using WebApiExportToFile; //code // Add services to the container. //WebApiExportToFile.AddExport(builder.Services); builder.Services.AddExport(); var app = builder.Build(); app.UseExport();

Add to any url : .xlsx or .csv ( e.g.

for /WeatherForecast put /WeatherForecast.xlsx

for /WeatherForecast/GetPerson?id=23 put /WeatherForecast/GetPerson.xlsx?id=23

)

and the excel will be downloaded

Examples

JSON value type array: https://tiltwebapp.azurewebsites.net/api/PublicTILTs/PublicTiltsURL

Excel: https://tiltwebapp.azurewebsites.net/api/PublicTILTs/PublicTiltsURL.xlsx

JSON object array: https://tiltwebapp.azurewebsites.net/api/PublicTILTs/LatestTILTs/ignatandrei/10

Excel: https://tiltwebapp.azurewebsites.net/api/PublicTILTs/LatestTILTs/ignatandrei/10.xlsx

About

Add exports to file to WebAPI ( for the moment, just Excel / xlsx)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages