Files
Annamaria Sassi 4b41ed6dde - Gestito ReportDesign
- Importazione ReportDesign in ReportViewer
2026-04-03 12:31:42 +02:00

62 lines
2.0 KiB
C#

using DevExpress.Blazor.Reporting;
using DevExpress.DataAccess;
using DevExpress.DataAccess.Json;
using DevExpress.Drawing.Internal.Fonts.Interop;
using DevExpress.Security;
using DevExpress.XtraReports;
using DevExpress.XtraReports.UI;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
using TestDevExpress.Components.Reports;
namespace TestDevExpress.Components.Pages
{
public partial class ReportDesign
{
#region Protected Methods
private string pdfUrl
{
get => $"download-offer?id={oID}";
}
private int oID = 0;
protected override void OnInitialized()
{
// calcolo i parametri x IMG e Json da conf
string apiUrl = _config.GetValue<string>("ServerConf:ApiBaseUrl") ?? "https://iis01.egalware.com/lux/srv/api";
string imgUrl = _config.GetValue<string>("ServerConf:ImageUrl") ?? "image";
string dataUrl = _config.GetValue<string>("ServerConf:DataUrl") ?? "report/offert/";
string imgFullUrl = $"{apiUrl}/{imgUrl}/";
string dataFullUrl = $"{apiUrl}/{dataUrl}";
//cerco id da URL x offerta da mostrare
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("OfferId", out var offerId))
{
int.TryParse(offerId, out oID);
currReport = new OfferReport(dataFullUrl, oID);
currReport.Parameters["pImgPath"].Value = imgFullUrl;
}
}
#endregion Protected Methods
#region Private Fields
private OfferReport currReport = new();
private DxReportViewer? reportViewer;
#endregion Private Fields
#region Private Properties
[Inject]
private IConfiguration _config { get; set; } = null!;
[Inject]
private NavigationManager NavManager { get; set; } = null!;
#endregion Private Properties
}
}