Devexpress Report Viewer kısmı Sector tablosuna bağlandı
This commit is contained in:
parent
233d97c2ec
commit
132887d2a9
11 changed files with 72 additions and 1553 deletions
|
|
@ -1,67 +0,0 @@
|
|||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Erp.Reports.HttpApi.Host.Data;
|
||||
|
||||
public class SqlDataConnectionDescription : DataConnection { }
|
||||
public class JsonDataConnectionDescription : DataConnection { }
|
||||
|
||||
public abstract class DataConnection
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string ConnectionString { get; set; }
|
||||
}
|
||||
|
||||
public class LegacyReportDbContext : DbContext
|
||||
{
|
||||
public DbSet<JsonDataConnectionDescription> JsonDataConnections { get; set; }
|
||||
public DbSet<SqlDataConnectionDescription> SqlDataConnections { get; set; }
|
||||
|
||||
public LegacyReportDbContext(DbContextOptions<LegacyReportDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public void InitializeDatabase()
|
||||
{
|
||||
Database.EnsureCreated();
|
||||
|
||||
var nwindJsonDataConnectionName = "NWindProductsJson";
|
||||
if (!JsonDataConnections.Any(x => x.Name == nwindJsonDataConnectionName))
|
||||
{
|
||||
var newData = new JsonDataConnectionDescription
|
||||
{
|
||||
Name = nwindJsonDataConnectionName,
|
||||
DisplayName = "Northwind Products (JSON)",
|
||||
ConnectionString = "Uri=Data/nwind.json"
|
||||
};
|
||||
JsonDataConnections.Add(newData);
|
||||
}
|
||||
|
||||
var nwindSqlDataConnectionName = "NWindConnectionString";
|
||||
if (!SqlDataConnections.Any(x => x.Name == nwindSqlDataConnectionName))
|
||||
{
|
||||
var newData = new SqlDataConnectionDescription
|
||||
{
|
||||
Name = nwindSqlDataConnectionName,
|
||||
DisplayName = "Northwind Data Connection",
|
||||
ConnectionString = "XpoProvider=SQLite;Data Source=|DataDirectory|Data/nwind.db"
|
||||
};
|
||||
SqlDataConnections.Add(newData);
|
||||
}
|
||||
|
||||
var reportsDataConnectionName = "ReportsDataSqlite";
|
||||
if (!SqlDataConnections.Any(x => x.Name == reportsDataConnectionName))
|
||||
{
|
||||
var newData = new SqlDataConnectionDescription
|
||||
{
|
||||
Name = reportsDataConnectionName,
|
||||
DisplayName = "Reports Data (Demo)",
|
||||
ConnectionString = "XpoProvider=SQLite;Data Source=|DataDirectory|Data/reportsData.db"
|
||||
};
|
||||
SqlDataConnections.Add(newData);
|
||||
}
|
||||
SaveChanges();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -44,15 +44,6 @@
|
|||
<None Remove="Logs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Data\nwind.db">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Data\reportsData.db">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="PredefinedReports\TestReport.cs">
|
||||
<SubType>XtraReport</SubType>
|
||||
|
|
|
|||
|
|
@ -411,11 +411,9 @@ public class PlatformHttpApiHostModule : AbpModule
|
|||
// Register report storage extension
|
||||
context.Services.AddScoped<ReportStorageWebExtension, CustomReportStorageWebExtension>();
|
||||
|
||||
// Register custom data connection providers
|
||||
// Register custom SQL data connection provider
|
||||
context.Services.AddScoped<CustomSqlDataConnectionProviderFactory>();
|
||||
context.Services.AddScoped<CustomJsonDataConnectionProviderFactory>();
|
||||
context.Services.AddScoped<CustomSqlDataSourceWizardConnectionStringsProvider>();
|
||||
context.Services.AddScoped<CustomDataSourceWizardJsonDataConnectionStorage>();
|
||||
}
|
||||
|
||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
||||
|
|
|
|||
|
|
@ -29,17 +29,9 @@
|
|||
DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery();
|
||||
DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression1 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
DevExpress.DataAccess.Sql.Table table4 = new DevExpress.DataAccess.Sql.Table();
|
||||
DevExpress.DataAccess.Sql.Table table1 = new DevExpress.DataAccess.Sql.Table();
|
||||
DevExpress.DataAccess.Sql.Column column2 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression2 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
DevExpress.DataAccess.Sql.Column column3 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression3 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
DevExpress.DataAccess.Sql.Column column4 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression4 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
DevExpress.DataAccess.Sql.Column column5 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression5 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
DevExpress.DataAccess.Sql.Column column6 = new DevExpress.DataAccess.Sql.Column();
|
||||
DevExpress.DataAccess.Sql.ColumnExpression columnExpression6 = new DevExpress.DataAccess.Sql.ColumnExpression();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestReport));
|
||||
this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
|
||||
this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
|
||||
|
|
@ -47,44 +39,18 @@
|
|||
this.pageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo();
|
||||
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
|
||||
this.label1 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
|
||||
this.table1 = new DevExpress.XtraReports.UI.XRTable();
|
||||
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
|
||||
this.table2 = new DevExpress.XtraReports.UI.XRTable();
|
||||
this.tableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
|
||||
this.tableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand();
|
||||
this.table2 = new DevExpress.XtraReports.UI.XRTable();
|
||||
this.tableRow2 = new DevExpress.XtraReports.UI.XRTableRow();
|
||||
this.tableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell7 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
|
||||
this.table3 = new DevExpress.XtraReports.UI.XRTable();
|
||||
this.tableRow3 = new DevExpress.XtraReports.UI.XRTableRow();
|
||||
this.tableCell8 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell9 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.tableCell10 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.pictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
|
||||
this.tableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.pictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox();
|
||||
this.tableCell12 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.pictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox();
|
||||
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
|
||||
this.label2 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components);
|
||||
this.Title = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.GroupCaption1 = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.GroupData1 = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.DetailCaption1 = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.DetailData1 = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.GroupFooterBackground3 = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.DetailData3_Odd = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle();
|
||||
((System.ComponentModel.ISupportInitialize)(this.table1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.table2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.table3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
|
||||
//
|
||||
// TopMargin
|
||||
|
|
@ -128,26 +94,23 @@
|
|||
this.label1.Name = "label1";
|
||||
this.label1.SizeF = new System.Drawing.SizeF(650F, 24.19433F);
|
||||
this.label1.StyleName = "Title";
|
||||
this.label1.Text = "Report";
|
||||
this.label1.Text = "Sector Report";
|
||||
//
|
||||
// GroupHeader1
|
||||
// Detail
|
||||
//
|
||||
this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.table1});
|
||||
this.GroupHeader1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] {
|
||||
new DevExpress.XtraReports.UI.GroupField("CategoryID", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)});
|
||||
this.GroupHeader1.GroupUnion = DevExpress.XtraReports.UI.GroupUnion.WithFirstDetail;
|
||||
this.GroupHeader1.HeightF = 27F;
|
||||
this.GroupHeader1.Level = 1;
|
||||
this.GroupHeader1.Name = "GroupHeader1";
|
||||
this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.table2});
|
||||
this.Detail.HeightF = 25F;
|
||||
this.Detail.Name = "Detail";
|
||||
//
|
||||
// table1
|
||||
// table2
|
||||
//
|
||||
this.table1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 2F);
|
||||
this.table1.Name = "table1";
|
||||
this.table1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
|
||||
this.table2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
|
||||
this.table2.Name = "table2";
|
||||
this.table2.OddStyleName = "DetailData3_Odd";
|
||||
this.table2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
|
||||
this.tableRow1});
|
||||
this.table1.SizeF = new System.Drawing.SizeF(650F, 25F);
|
||||
this.table2.SizeF = new System.Drawing.SizeF(650F, 25F);
|
||||
//
|
||||
// tableRow1
|
||||
//
|
||||
|
|
@ -159,234 +122,39 @@
|
|||
//
|
||||
// tableCell1
|
||||
//
|
||||
this.tableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None;
|
||||
this.tableCell1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Id]")});
|
||||
this.tableCell1.Name = "tableCell1";
|
||||
this.tableCell1.StyleName = "GroupCaption1";
|
||||
this.tableCell1.Text = "CATEGORY ID";
|
||||
this.tableCell1.Weight = 1434852.375D;
|
||||
this.tableCell1.StyleName = "DetailData1";
|
||||
this.tableCell1.StylePriority.UseBorders = false;
|
||||
this.tableCell1.Text = "Id";
|
||||
this.tableCell1.Weight = 0.3D;
|
||||
//
|
||||
// tableCell2
|
||||
//
|
||||
this.tableCell2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[CategoryID]")});
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Name]")});
|
||||
this.tableCell2.Name = "tableCell2";
|
||||
this.tableCell2.StyleName = "GroupData1";
|
||||
this.tableCell2.Weight = 9214747D;
|
||||
//
|
||||
// GroupHeader2
|
||||
//
|
||||
this.GroupHeader2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.table2});
|
||||
this.GroupHeader2.GroupUnion = DevExpress.XtraReports.UI.GroupUnion.WithFirstDetail;
|
||||
this.GroupHeader2.HeightF = 28F;
|
||||
this.GroupHeader2.Level = 2;
|
||||
this.GroupHeader2.Name = "GroupHeader2";
|
||||
//
|
||||
// table2
|
||||
//
|
||||
this.table2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
|
||||
this.table2.Name = "table2";
|
||||
this.table2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
|
||||
this.tableRow2});
|
||||
this.table2.SizeF = new System.Drawing.SizeF(650F, 28F);
|
||||
//
|
||||
// tableRow2
|
||||
//
|
||||
this.tableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
|
||||
this.tableCell3,
|
||||
this.tableCell4,
|
||||
this.tableCell5,
|
||||
this.tableCell6,
|
||||
this.tableCell7});
|
||||
this.tableRow2.Name = "tableRow2";
|
||||
this.tableRow2.Weight = 1D;
|
||||
//
|
||||
// tableCell3
|
||||
//
|
||||
this.tableCell3.Borders = DevExpress.XtraPrinting.BorderSide.None;
|
||||
this.tableCell3.Name = "tableCell3";
|
||||
this.tableCell3.StyleName = "DetailCaption1";
|
||||
this.tableCell3.StylePriority.UseBorders = false;
|
||||
this.tableCell3.Text = "Category Name";
|
||||
this.tableCell3.Weight = 0.29834482046274041D;
|
||||
//
|
||||
// tableCell4
|
||||
//
|
||||
this.tableCell4.Name = "tableCell4";
|
||||
this.tableCell4.StyleName = "DetailCaption1";
|
||||
this.tableCell4.Text = "Description";
|
||||
this.tableCell4.Weight = 0.2344280066856971D;
|
||||
//
|
||||
// tableCell5
|
||||
//
|
||||
this.tableCell5.Name = "tableCell5";
|
||||
this.tableCell5.StyleName = "DetailCaption1";
|
||||
this.tableCell5.Text = "Picture";
|
||||
this.tableCell5.Weight = 0.1609015596829928D;
|
||||
//
|
||||
// tableCell6
|
||||
//
|
||||
this.tableCell6.Name = "tableCell6";
|
||||
this.tableCell6.StyleName = "DetailCaption1";
|
||||
this.tableCell6.Text = "Icon17";
|
||||
this.tableCell6.Weight = 0.153162841796875D;
|
||||
//
|
||||
// tableCell7
|
||||
//
|
||||
this.tableCell7.Name = "tableCell7";
|
||||
this.tableCell7.StyleName = "DetailCaption1";
|
||||
this.tableCell7.Text = "Icon25";
|
||||
this.tableCell7.Weight = 0.15316274789663462D;
|
||||
//
|
||||
// Detail
|
||||
//
|
||||
this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.table3});
|
||||
this.Detail.HeightF = 25F;
|
||||
this.Detail.Name = "Detail";
|
||||
//
|
||||
// table3
|
||||
//
|
||||
this.table3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
|
||||
this.table3.Name = "table3";
|
||||
this.table3.OddStyleName = "DetailData3_Odd";
|
||||
this.table3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
|
||||
this.tableRow3});
|
||||
this.table3.SizeF = new System.Drawing.SizeF(650F, 25F);
|
||||
//
|
||||
// tableRow3
|
||||
//
|
||||
this.tableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
|
||||
this.tableCell8,
|
||||
this.tableCell9,
|
||||
this.tableCell10,
|
||||
this.tableCell11,
|
||||
this.tableCell12});
|
||||
this.tableRow3.Name = "tableRow3";
|
||||
this.tableRow3.Weight = 11.5D;
|
||||
//
|
||||
// tableCell8
|
||||
//
|
||||
this.tableCell8.Borders = DevExpress.XtraPrinting.BorderSide.None;
|
||||
this.tableCell8.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[CategoryName]")});
|
||||
this.tableCell8.Name = "tableCell8";
|
||||
this.tableCell8.StyleName = "DetailData1";
|
||||
this.tableCell8.StylePriority.UseBorders = false;
|
||||
this.tableCell8.Weight = 0.29834482046274041D;
|
||||
//
|
||||
// tableCell9
|
||||
//
|
||||
this.tableCell9.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Description]")});
|
||||
this.tableCell9.Name = "tableCell9";
|
||||
this.tableCell9.StyleName = "DetailData1";
|
||||
this.tableCell9.Weight = 0.2344280066856971D;
|
||||
//
|
||||
// tableCell10
|
||||
//
|
||||
this.tableCell10.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.pictureBox1});
|
||||
this.tableCell10.Name = "tableCell10";
|
||||
this.tableCell10.StyleName = "DetailData1";
|
||||
this.tableCell10.Weight = 0.1609015596829928D;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right)));
|
||||
this.pictureBox1.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom)));
|
||||
this.pictureBox1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Picture]")});
|
||||
this.pictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.SizeF = new System.Drawing.SizeF(102.5027F, 25F);
|
||||
this.pictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
|
||||
//
|
||||
// tableCell11
|
||||
//
|
||||
this.tableCell11.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.pictureBox2});
|
||||
this.tableCell11.Name = "tableCell11";
|
||||
this.tableCell11.StyleName = "DetailData1";
|
||||
this.tableCell11.Weight = 0.153162841796875D;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right)));
|
||||
this.pictureBox2.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom)));
|
||||
this.pictureBox2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Icon17]")});
|
||||
this.pictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.SizeF = new System.Drawing.SizeF(97.47251F, 25F);
|
||||
this.pictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
|
||||
//
|
||||
// tableCell12
|
||||
//
|
||||
this.tableCell12.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.pictureBox3});
|
||||
this.tableCell12.Name = "tableCell12";
|
||||
this.tableCell12.StyleName = "DetailData1";
|
||||
this.tableCell12.Weight = 0.15316274789663462D;
|
||||
//
|
||||
// pictureBox3
|
||||
//
|
||||
this.pictureBox3.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right)));
|
||||
this.pictureBox3.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom)));
|
||||
this.pictureBox3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
|
||||
new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Icon25]")});
|
||||
this.pictureBox3.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F);
|
||||
this.pictureBox3.Name = "pictureBox3";
|
||||
this.pictureBox3.SizeF = new System.Drawing.SizeF(97.47245F, 25F);
|
||||
this.pictureBox3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
|
||||
//
|
||||
// GroupFooter1
|
||||
//
|
||||
this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.label2});
|
||||
this.GroupFooter1.GroupUnion = DevExpress.XtraReports.UI.GroupFooterUnion.WithLastDetail;
|
||||
this.GroupFooter1.HeightF = 6F;
|
||||
this.GroupFooter1.Name = "GroupFooter1";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Borders = DevExpress.XtraPrinting.BorderSide.None;
|
||||
this.label2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.SizeF = new System.Drawing.SizeF(650F, 2.08F);
|
||||
this.label2.StyleName = "GroupFooterBackground3";
|
||||
this.label2.StylePriority.UseBorders = false;
|
||||
this.tableCell2.StyleName = "DetailData1";
|
||||
this.tableCell2.Text = "Name";
|
||||
this.tableCell2.Weight = 0.7D;
|
||||
//
|
||||
// sqlDataSource1
|
||||
//
|
||||
this.sqlDataSource1.ConnectionName = "NWindConnectionString";
|
||||
this.sqlDataSource1.ConnectionName = "SqlServer";
|
||||
this.sqlDataSource1.Name = "sqlDataSource1";
|
||||
columnExpression1.ColumnName = "CategoryID";
|
||||
table4.Name = "Categories";
|
||||
columnExpression1.Table = table4;
|
||||
columnExpression1.ColumnName = "Id";
|
||||
table1.Name = "Sas_T_Sector";
|
||||
columnExpression1.Table = table1;
|
||||
column1.Expression = columnExpression1;
|
||||
columnExpression2.ColumnName = "CategoryName";
|
||||
columnExpression2.Table = table4;
|
||||
columnExpression2.ColumnName = "Name";
|
||||
columnExpression2.Table = table1;
|
||||
column2.Expression = columnExpression2;
|
||||
columnExpression3.ColumnName = "Description";
|
||||
columnExpression3.Table = table4;
|
||||
column3.Expression = columnExpression3;
|
||||
columnExpression4.ColumnName = "Picture";
|
||||
columnExpression4.Table = table4;
|
||||
column4.Expression = columnExpression4;
|
||||
columnExpression5.ColumnName = "Icon17";
|
||||
columnExpression5.Table = table4;
|
||||
column5.Expression = columnExpression5;
|
||||
columnExpression6.ColumnName = "Icon25";
|
||||
columnExpression6.Table = table4;
|
||||
column6.Expression = columnExpression6;
|
||||
selectQuery1.Columns.Add(column1);
|
||||
selectQuery1.Columns.Add(column2);
|
||||
selectQuery1.Columns.Add(column3);
|
||||
selectQuery1.Columns.Add(column4);
|
||||
selectQuery1.Columns.Add(column5);
|
||||
selectQuery1.Columns.Add(column6);
|
||||
selectQuery1.Name = "Categories";
|
||||
selectQuery1.Tables.Add(table4);
|
||||
selectQuery1.Name = "Sas_T_Sector";
|
||||
selectQuery1.Tables.Add(table1);
|
||||
this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] {
|
||||
selectQuery1});
|
||||
this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable");
|
||||
|
|
@ -402,30 +170,6 @@
|
|||
this.Title.Name = "Title";
|
||||
this.Title.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F);
|
||||
//
|
||||
// GroupCaption1
|
||||
//
|
||||
this.GroupCaption1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142)))));
|
||||
this.GroupCaption1.BorderColor = System.Drawing.Color.White;
|
||||
this.GroupCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
|
||||
this.GroupCaption1.BorderWidth = 2F;
|
||||
this.GroupCaption1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold);
|
||||
this.GroupCaption1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(228)))), ((int)(((byte)(228)))));
|
||||
this.GroupCaption1.Name = "GroupCaption1";
|
||||
this.GroupCaption1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F);
|
||||
this.GroupCaption1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
|
||||
//
|
||||
// GroupData1
|
||||
//
|
||||
this.GroupData1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142)))));
|
||||
this.GroupData1.BorderColor = System.Drawing.Color.White;
|
||||
this.GroupData1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
|
||||
this.GroupData1.BorderWidth = 2F;
|
||||
this.GroupData1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold);
|
||||
this.GroupData1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(70)))), ((int)(((byte)(80)))));
|
||||
this.GroupData1.Name = "GroupData1";
|
||||
this.GroupData1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F);
|
||||
this.GroupData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
|
||||
//
|
||||
// DetailCaption1
|
||||
//
|
||||
this.DetailCaption1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142)))));
|
||||
|
|
@ -449,18 +193,6 @@
|
|||
this.DetailData1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F);
|
||||
this.DetailData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
|
||||
//
|
||||
// GroupFooterBackground3
|
||||
//
|
||||
this.GroupFooterBackground3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(117)))), ((int)(((byte)(129)))));
|
||||
this.GroupFooterBackground3.BorderColor = System.Drawing.Color.White;
|
||||
this.GroupFooterBackground3.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
|
||||
this.GroupFooterBackground3.BorderWidth = 2F;
|
||||
this.GroupFooterBackground3.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold);
|
||||
this.GroupFooterBackground3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(228)))), ((int)(((byte)(228)))));
|
||||
this.GroupFooterBackground3.Name = "GroupFooterBackground3";
|
||||
this.GroupFooterBackground3.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F);
|
||||
this.GroupFooterBackground3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
|
||||
//
|
||||
// DetailData3_Odd
|
||||
//
|
||||
this.DetailData3_Odd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(245)))), ((int)(((byte)(248)))));
|
||||
|
|
@ -486,28 +218,20 @@
|
|||
this.TopMargin,
|
||||
this.BottomMargin,
|
||||
this.ReportHeader,
|
||||
this.GroupHeader1,
|
||||
this.GroupHeader2,
|
||||
this.Detail,
|
||||
this.GroupFooter1});
|
||||
this.Detail});
|
||||
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
|
||||
this.sqlDataSource1});
|
||||
this.DataMember = "Categories";
|
||||
this.DataMember = "Sas_T_Sector";
|
||||
this.DataSource = this.sqlDataSource1;
|
||||
this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
|
||||
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
|
||||
this.Title,
|
||||
this.GroupCaption1,
|
||||
this.GroupData1,
|
||||
this.DetailCaption1,
|
||||
this.DetailData1,
|
||||
this.GroupFooterBackground3,
|
||||
this.DetailData3_Odd,
|
||||
this.PageInfo});
|
||||
this.Version = "22.2";
|
||||
((System.ComponentModel.ISupportInitialize)(this.table1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.table2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.table3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
|
||||
|
||||
}
|
||||
|
|
@ -520,39 +244,15 @@
|
|||
private DevExpress.XtraReports.UI.XRPageInfo pageInfo2;
|
||||
private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader;
|
||||
private DevExpress.XtraReports.UI.XRLabel label1;
|
||||
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1;
|
||||
private DevExpress.XtraReports.UI.XRTable table1;
|
||||
private DevExpress.XtraReports.UI.DetailBand Detail;
|
||||
private DevExpress.XtraReports.UI.XRTable table2;
|
||||
private DevExpress.XtraReports.UI.XRTableRow tableRow1;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell1;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell2;
|
||||
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader2;
|
||||
private DevExpress.XtraReports.UI.XRTable table2;
|
||||
private DevExpress.XtraReports.UI.XRTableRow tableRow2;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell3;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell4;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell5;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell6;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell7;
|
||||
private DevExpress.XtraReports.UI.DetailBand Detail;
|
||||
private DevExpress.XtraReports.UI.XRTable table3;
|
||||
private DevExpress.XtraReports.UI.XRTableRow tableRow3;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell8;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell9;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell10;
|
||||
private DevExpress.XtraReports.UI.XRPictureBox pictureBox1;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell11;
|
||||
private DevExpress.XtraReports.UI.XRPictureBox pictureBox2;
|
||||
private DevExpress.XtraReports.UI.XRTableCell tableCell12;
|
||||
private DevExpress.XtraReports.UI.XRPictureBox pictureBox3;
|
||||
private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1;
|
||||
private DevExpress.XtraReports.UI.XRLabel label2;
|
||||
private DevExpress.DataAccess.Sql.SqlDataSource sqlDataSource1;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle Title;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle GroupCaption1;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle GroupData1;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle DetailCaption1;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle DetailData1;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle GroupFooterBackground3;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle DetailData3_Odd;
|
||||
private DevExpress.XtraReports.UI.XRControlStyle PageInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Web;
|
||||
using DevExpress.DataAccess.Wizard.Services;
|
||||
using Erp.Reports.HttpApi.Host.Data;
|
||||
|
||||
namespace Erp.Platform.ReportServices;
|
||||
|
||||
public class CustomDataSourceWizardJsonDataConnectionStorage : IDataSourceWizardJsonConnectionStorage
|
||||
{
|
||||
protected LegacyReportDbContext DbContext { get; }
|
||||
|
||||
public CustomDataSourceWizardJsonDataConnectionStorage(LegacyReportDbContext dbContext)
|
||||
{
|
||||
DbContext = dbContext;
|
||||
}
|
||||
|
||||
public List<JsonDataConnectionDescription> GetConnections()
|
||||
{
|
||||
return DbContext.JsonDataConnections.ToList();
|
||||
}
|
||||
|
||||
bool IJsonConnectionStorageService.CanSaveConnection { get { return DbContext.JsonDataConnections != null; } }
|
||||
|
||||
bool IJsonConnectionStorageService.ContainsConnection(string connectionName)
|
||||
{
|
||||
return GetConnections().Any(x => x.Name == connectionName);
|
||||
}
|
||||
|
||||
IEnumerable<JsonDataConnection> IJsonConnectionStorageService.GetConnections()
|
||||
{
|
||||
return GetConnections().Select(x => CreateJsonDataConnectionFromString(x));
|
||||
}
|
||||
|
||||
JsonDataConnection IJsonDataConnectionProviderService.GetJsonDataConnection(string name)
|
||||
{
|
||||
var connection = GetConnections().FirstOrDefault(x => x.Name == name);
|
||||
if (connection == null)
|
||||
throw new InvalidOperationException();
|
||||
return CreateJsonDataConnectionFromString(connection);
|
||||
}
|
||||
|
||||
void IJsonConnectionStorageService.SaveConnection(string connectionName, JsonDataConnection dataConnection, bool saveCredentials)
|
||||
{
|
||||
var connections = GetConnections();
|
||||
var connectionString = dataConnection.CreateConnectionString();
|
||||
foreach (var connection in connections)
|
||||
{
|
||||
if (connection.Name == connectionName)
|
||||
{
|
||||
connection.ConnectionString = connectionString;
|
||||
DbContext.SaveChanges();
|
||||
return;
|
||||
}
|
||||
}
|
||||
DbContext.JsonDataConnections.Add(new JsonDataConnectionDescription() { Name = connectionName, ConnectionString = connectionString });
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
|
||||
public static JsonDataConnection CreateJsonDataConnectionFromString(DataConnection dataConnection)
|
||||
{
|
||||
return new JsonDataConnection(dataConnection.ConnectionString) { StoreConnectionNameOnly = true, Name = dataConnection.Name };
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Web;
|
||||
using Erp.Reports.HttpApi.Host.Data;
|
||||
|
||||
namespace Erp.Platform.ReportServices;
|
||||
|
||||
public class CustomJsonDataConnectionProviderFactory : IJsonDataConnectionProviderFactory
|
||||
{
|
||||
protected LegacyReportDbContext DbContext { get; }
|
||||
|
||||
public CustomJsonDataConnectionProviderFactory(LegacyReportDbContext dbContext)
|
||||
{
|
||||
DbContext = dbContext;
|
||||
}
|
||||
|
||||
public IJsonDataConnectionProviderService Create()
|
||||
{
|
||||
return new WebDocumentViewerJsonDataConnectionProvider(DbContext.JsonDataConnections.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
public class WebDocumentViewerJsonDataConnectionProvider : IJsonDataConnectionProviderService
|
||||
{
|
||||
readonly IEnumerable<DataConnection> jsonDataConnections;
|
||||
|
||||
public WebDocumentViewerJsonDataConnectionProvider(IEnumerable<DataConnection> jsonDataConnections)
|
||||
{
|
||||
this.jsonDataConnections = jsonDataConnections;
|
||||
}
|
||||
|
||||
public JsonDataConnection GetJsonDataConnection(string name)
|
||||
{
|
||||
var connection = jsonDataConnections.FirstOrDefault(x => x.Name == name);
|
||||
if (connection == null)
|
||||
throw new InvalidOperationException();
|
||||
return CustomDataSourceWizardJsonDataConnectionStorage.CreateJsonDataConnectionFromString(connection);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using DevExpress.DataAccess.ConnectionParameters;
|
||||
using DevExpress.DataAccess.Sql;
|
||||
using DevExpress.DataAccess.Web;
|
||||
using static Erp.Settings.SettingsConsts;
|
||||
using DevExpress.DataAccess.Wizard.Services;
|
||||
using Erp.Reports.HttpApi.Host.Data;
|
||||
|
||||
namespace Erp.Platform.ReportServices;
|
||||
|
||||
public class CustomSqlDataConnectionProviderFactory : IConnectionProviderFactory
|
||||
{
|
||||
private readonly LegacyReportDbContext reportDbContext;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public CustomSqlDataConnectionProviderFactory(LegacyReportDbContext reportDbContext)
|
||||
public CustomSqlDataConnectionProviderFactory(IConfiguration configuration)
|
||||
{
|
||||
this.reportDbContext = reportDbContext;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public IConnectionProviderService Create()
|
||||
{
|
||||
return new CustomSqlConnectionProviderService(reportDbContext.SqlDataConnections.ToList());
|
||||
return new CustomSqlConnectionProviderService(_configuration);
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomSqlConnectionProviderService : IConnectionProviderService
|
||||
{
|
||||
readonly IEnumerable<DataConnection> sqlDataConnections;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public CustomSqlConnectionProviderService(IEnumerable<DataConnection> sqlDataConnections)
|
||||
public CustomSqlConnectionProviderService(IConfiguration configuration)
|
||||
{
|
||||
this.sqlDataConnections = sqlDataConnections;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public SqlDataConnection LoadConnection(string connectionName)
|
||||
{
|
||||
var sqlDataConnectionData = sqlDataConnections.FirstOrDefault(x => x.Name == connectionName);
|
||||
if (sqlDataConnectionData == null)
|
||||
throw new InvalidOperationException();
|
||||
|
||||
if (string.IsNullOrEmpty(sqlDataConnectionData.ConnectionString))
|
||||
throw new KeyNotFoundException($"Connection string '{connectionName}' not found.");
|
||||
// appsettings.json'dan SQL Server connection string'ini al
|
||||
var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider);
|
||||
|
||||
var connectionParameters = new CustomStringConnectionParameters(sqlDataConnectionData.ConnectionString);
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
throw new InvalidOperationException($"Connection string for '{DefaultDatabaseProvider}' not found in configuration.");
|
||||
|
||||
// SQL Server için CustomStringConnectionParameters kullan
|
||||
var connectionParameters = new CustomStringConnectionParameters(connectionString);
|
||||
return new SqlDataConnection(connectionName, connectionParameters);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using DevExpress.DataAccess.ConnectionParameters;
|
||||
using DevExpress.DataAccess.Web;
|
||||
using Erp.Reports.HttpApi.Host.Data;
|
||||
using static Erp.Settings.SettingsConsts;
|
||||
|
||||
namespace Erp.Platform.ReportServices;
|
||||
|
||||
public class CustomSqlDataSourceWizardConnectionStringsProvider : IDataSourceWizardConnectionStringsProvider
|
||||
{
|
||||
readonly LegacyReportDbContext reportDataContext;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public CustomSqlDataSourceWizardConnectionStringsProvider(LegacyReportDbContext reportDataContext)
|
||||
public CustomSqlDataSourceWizardConnectionStringsProvider(IConfiguration configuration)
|
||||
{
|
||||
this.reportDataContext = reportDataContext;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
Dictionary<string, string> IDataSourceWizardConnectionStringsProvider.GetConnectionDescriptions()
|
||||
{
|
||||
return reportDataContext.SqlDataConnections.ToDictionary(x => x.Name, x => x.DisplayName);
|
||||
// SqlServer adında bir bağlantı tanımla
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "SqlServer", "SQL Server Database Connection" }
|
||||
};
|
||||
}
|
||||
|
||||
DataConnectionParametersBase IDataSourceWizardConnectionStringsProvider.GetDataConnectionParameters(string name)
|
||||
{
|
||||
return null;
|
||||
var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider);
|
||||
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
return null;
|
||||
|
||||
return new CustomStringConnectionParameters(connectionString);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue