Report Template View / Design

This commit is contained in:
Sedat Öztürk 2026-03-28 10:04:13 +03:00
parent 8c54c6590c
commit 97620e532f
3 changed files with 19 additions and 12 deletions

View file

@ -4,6 +4,7 @@ using DevExpress.DataAccess.Sql;
using DevExpress.XtraReports.Web.ReportDesigner; using DevExpress.XtraReports.Web.ReportDesigner;
using DevExpress.XtraReports.Web.ReportDesigner.Services; using DevExpress.XtraReports.Web.ReportDesigner.Services;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Sozsoft.Platform.Enums;
namespace Sozsoft.Platform.Controllers; namespace Sozsoft.Platform.Controllers;
@ -23,9 +24,9 @@ public class CustomReportDesignerController : ReportDesignerController
var ds = new SqlDataSource("SqlServer"); var ds = new SqlDataSource("SqlServer");
SelectQuery query = SelectQueryFluentBuilder SelectQuery query = SelectQueryFluentBuilder
.AddTable("Sas_T_Sector") .AddTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Sector)))
.SelectAllColumnsFromTable() .SelectAllColumnsFromTable()
.Build("Sas_T_Sector"); .Build(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Sector)));
ds.Queries.Add(query); ds.Queries.Add(query);
ds.RebuildResultSchema(); ds.RebuildResultSchema();

View file

@ -1,4 +1,5 @@
using DevExpress.XtraReports.UI; using DevExpress.XtraReports.UI;
using Sozsoft.Platform.Enums;
namespace Sozsoft.Reports.PredefinedReports namespace Sozsoft.Reports.PredefinedReports
{ {
@ -104,12 +105,12 @@ namespace Sozsoft.Reports.PredefinedReports
// //
this.sqlDataSource1.ConnectionName = "SqlServer"; this.sqlDataSource1.ConnectionName = "SqlServer";
this.sqlDataSource1.Name = "sqlDataSource1"; this.sqlDataSource1.Name = "sqlDataSource1";
table1.Name = "Sas_T_ReportTemplate"; table1.Name = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ReportTemplate));
columnExpression1.ColumnName = "HtmlContent"; columnExpression1.ColumnName = "HtmlContent";
columnExpression1.Table = table1; columnExpression1.Table = table1;
column1.Expression = columnExpression1; column1.Expression = columnExpression1;
selectQuery1.Columns.Add(column1); selectQuery1.Columns.Add(column1);
selectQuery1.Name = "Sas_T_ReportTemplate"; selectQuery1.Name = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ReportTemplate));
selectQuery1.Tables.Add(table1); selectQuery1.Tables.Add(table1);
this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] { selectQuery1 }); this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] { selectQuery1 });
this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable"); this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable");
@ -176,7 +177,7 @@ namespace Sozsoft.Reports.PredefinedReports
this.Detail}); this.Detail});
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
this.sqlDataSource1}); this.sqlDataSource1});
this.DataMember = "Sas_T_ReportTemplate"; this.DataMember = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ReportTemplate));
this.DataSource = this.sqlDataSource1; this.DataSource = this.sqlDataSource1;
this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] { this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {

View file

@ -1,4 +1,6 @@
namespace Sozsoft.Reports.PredefinedReports using Sozsoft.Platform.Enums;
namespace Sozsoft.Reports.PredefinedReports
{ {
partial class TestReport partial class TestReport
{ {
@ -11,8 +13,10 @@
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) { protected override void Dispose(bool disposing)
if(disposing && (components != null)) { {
if (disposing && (components != null))
{
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
@ -24,7 +28,8 @@
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent()
{
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery(); DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery();
DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column(); DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column();
@ -145,7 +150,7 @@
this.sqlDataSource1.ConnectionName = "SqlServer"; this.sqlDataSource1.ConnectionName = "SqlServer";
this.sqlDataSource1.Name = "sqlDataSource1"; this.sqlDataSource1.Name = "sqlDataSource1";
columnExpression1.ColumnName = "Id"; columnExpression1.ColumnName = "Id";
table1.Name = "Sas_T_Sector"; table1.Name = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Sector));
columnExpression1.Table = table1; columnExpression1.Table = table1;
column1.Expression = columnExpression1; column1.Expression = columnExpression1;
columnExpression2.ColumnName = "Name"; columnExpression2.ColumnName = "Name";
@ -153,7 +158,7 @@
column2.Expression = columnExpression2; column2.Expression = columnExpression2;
selectQuery1.Columns.Add(column1); selectQuery1.Columns.Add(column1);
selectQuery1.Columns.Add(column2); selectQuery1.Columns.Add(column2);
selectQuery1.Name = "Sas_T_Sector"; selectQuery1.Name = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Sector));
selectQuery1.Tables.Add(table1); selectQuery1.Tables.Add(table1);
this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] { this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] {
selectQuery1}); selectQuery1});
@ -221,7 +226,7 @@
this.Detail}); this.Detail});
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
this.sqlDataSource1}); this.sqlDataSource1});
this.DataMember = "Sas_T_Sector"; this.DataMember = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Sector));
this.DataSource = this.sqlDataSource1; this.DataSource = this.sqlDataSource1;
this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] { this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {