![]() |
VOOZH | about |
dotnet add package Corprio.AspNetCore.XtraReportSite --version 2.0.31.262
NuGet\Install-Package Corprio.AspNetCore.XtraReportSite -Version 2.0.31.262
<PackageReference Include="Corprio.AspNetCore.XtraReportSite" Version="2.0.31.262" />
<PackageVersion Include="Corprio.AspNetCore.XtraReportSite" Version="2.0.31.262" />Directory.Packages.props
<PackageReference Include="Corprio.AspNetCore.XtraReportSite" />Project file
paket add Corprio.AspNetCore.XtraReportSite --version 2.0.31.262
#r "nuget: Corprio.AspNetCore.XtraReportSite, 2.0.31.262"
#:package Corprio.AspNetCore.XtraReportSite@2.0.31.262
#addin nuget:?package=Corprio.AspNetCore.XtraReportSite&version=2.0.31.262Install as a Cake Addin
#tool nuget:?package=Corprio.AspNetCore.XtraReportSite&version=2.0.31.262Install as a Cake Tool
The Corprio.AspNetCore.XtraReportSite is the base library for develpers to build a web applicaiton working with Corprio using ASP.NET Core and need to execute reports in the web application. If your application does not need to execute reports, then you can use Corprio.AspNetCore.Site instead.
The application is developed using ASP.NET Core 8, DevExtreme and XtraReports.
Follow the steps below to start building your web applicaiton with Corprio.
Download and install the latest version of Visual Studio from Microsoft. You will need to select components for building ASP.NET Core applications.
Your web application needs to work the Corprio API. Instead of directly calling the online API, you can clone the Corprio.Internal repository onto your development machine so that you can have the Corprio API server running in your development machine.
/// <summary>
/// Service for getting data for reports
/// </summary>
public class ReportDataService : BaseReportDataService
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="httpContextAccessor">HttpContextAccessor for getting organization ID from HttpContext</param>
/// <param name="corprio">Corprio client for getting data from server</param>
public ReportDataService(IHttpContextAccessor httpContextAccessor, APIClient corprio, IHttpClientFactory httpClientFactory) : base(httpContextAccessor, corprio, httpClientFactory)
{
}
public override IEnumerable<Type> GetAvailableTypes(string context)
{
return new Type[] {
//put the data types of your report data here, e.g. MySalesReportData
};
}
public override System.Collections.IEnumerable GetReportData(Type dataType, Guid organizationID, Dictionary<string, object> parameters)
{
//add code to return data for each of your report data type
throw new NotSupportedException($"DataType {dataType} is not supported");
}
public override IEnumerable<Corprio.DataModel.Report.Parameter> GetParametersOfDataType(Type reportDataType, string[] supportedLanguages)
{
//add code to return an array of Parameter for prompting users before executing the report
return Array.Empty<Corprio.DataModel.Report.Parameter>();
}
}
public void ConfigureServices(IServiceCollection services)
{
services.AddCommonAppServices(Configuration);
services.AddXtraReports<ReportDataService>();
}
"CorprioApiSetting": {
"AuthServerUrl": "https://localhost:44334", //replace with the port of your local AuthServer project
"ApiUrl": "https://localhost:44394", //replace with the port of your local Corprio API project
"ApiVersion": "1.0"
},
"CorprioClientCredential": {
"ClientID": "your app ID", //replace with the ID of your application which will be used to register your application in Corprio Portal
"ClientSecret": "xxxxxxxxxxxxxxxxxxx" //replace with the secret of your application
},
public class MySalesReportData
{
public string ProductName { get; set; }
public int QuantitySold { get; set; }
public decimal TotalSales { get; set; }
}
Save the class in the folder /Models/ReportData
public override IEnumerable<Type> GetAvailableTypes(string context)
{
return new Type[] {
typeof(MySalesReportData) //add your report data type here
};
}
public override System.Collections.IEnumerable GetReportData(Type dataType, Guid organizationID, Dictionary<string, object> parameters)
{
if (dataType == typeof(MySalesReportData))
{
//add code to return the data for MySalesReportData
return GetDataFromAPI((int pageIndex) =>
corprio.InvoiceApi.QueryLines<MySalesReportData>(
organizationID: organizationID,
dynamicQuery: new DynamicQuery
{
Selector = "new (Product.Name as ProductName,Qty as QuantitySold,LineAmount*np(Invoice.ExchangeRate,1) as TotalSales)",
Where = "Invoice.InvoiceDate>=@0 && Invoice.InvoiceDate<@1 && Invoice.IsVoided==false",
WhereArguments = new object[] { dateRange.Start, dateRange.End },
GroupBy = "",
Skip = BatchRecordSize * pageIndex,
Take = BatchRecordSize
}
)).GetAwaiter().GetResult();
}
throw new NotSupportedException($"DataType {dataType} is not supported");
}
public override IEnumerable<Corprio.DataModel.Report.Parameter> GetParametersOfDataType(Type reportDataType, string[] supportedLanguages)
{
if (reportDataType == typeof(MySalesReportData))
{
return new Corprio.DataModel.Report.Parameter[]
{
new Corprio.DataModel.Report.Parameter
{
Hidden = false,
Name = "dateRange",
Type = Corprio.DataModel.Report.ParameterType.DateRange,
Prompt= new Global.Globalization.GlobalizedText(
resourceType: typeof(DataModel.Resources.Resource),
key: "DateRange",
langCodes: supportedLanguages),
Required = true
}
};
}
return Array.Empty<Corprio.DataModel.Report.Parameter>();
}
Developers must register the report in their applications so that the report can be executed in the web application. follow the steps below to register the report.
You can run a report from code. For example, to print an invoice from an invoice record.
[HttpGet]
public async Task<IActionResult> Print([FromServices] ApplicationSettingService applicationSettingService,
[FromServices] IReportStorageService reportStorageService,
[FromRoute] Guid organizationID,
[FromRoute] Guid invoiceID)
{
//get definition of the report
string reportID = "InvoicePrintout";
ReportDefinition reportDefinition = await reportStorageService.GetReportDefinition(organizationID, reportID);
if (reportDefinition == null) return BadRequest($"Report {reportID} does not exist");
//call ExecuteReport action of the base controller to execute the report
return ExecuteReport(new ReportRequest
{
ReportID = reportID,
OrganizationID = organizationID,
Parameters = new Dictionary<string, object>() { ["invoiceID"] = invoiceID }
});
}
When the report is executed, the following steps are performed:
return RedirectToAction("ViewerRedirect", "Report", new { OrganizationID, request = reportRequest.ToUrl() });
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.31.262 | 150 | 3/12/2026 |
| 2.0.31.257 | 131 | 2/12/2026 |
| 2.0.31.139 | 481 | 10/9/2025 |
| 2.0.31.125 | 307 | 8/29/2025 |
| 2.0.31.124 | 220 | 7/29/2025 |
| 2.0.31.65 | 357 | 4/22/2025 |
| 2.0.31.54 | 301 | 3/31/2025 |
| 2.0.31.51 | 297 | 3/19/2025 |
| 2.0.31.15 | 275 | 1/23/2025 |
| 2.0.31 | 290 | 12/3/2024 |
| 2.0.30.1 | 244 | 11/29/2024 |
| 2.0.30 | 247 | 11/14/2024 |
| 2.0.29.55 | 313 | 9/23/2024 |
| 2.0.29.54 | 263 | 9/19/2024 |
| 2.0.29.38 | 253 | 9/9/2024 |
| 2.0.29 | 244 | 8/6/2024 |
| 2.0.28.1 | 206 | 8/5/2024 |
| 2.0.28 | 232 | 8/1/2024 |
| 2.0.27 | 227 | 7/31/2024 |
| 2.0.26.1 | 222 | 7/26/2024 |