Skip to content

Commit

Permalink
Merge pull request #268 from FastReports/sync_branch_637509732058278375
Browse files Browse the repository at this point in the history
FastReport OpenSource 2021.2.0
  • Loading branch information
KirillKornienko authored Mar 10, 2021
2 parents 01c2e77 + 63b1fc4 commit 572a836
Show file tree
Hide file tree
Showing 122 changed files with 50,435 additions and 3,281 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using FastReport.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastReport.ClickHouse
{
public class ClickHouseAssemblyInitializer : AssemblyInitializerBase
{
public ClickHouseAssemblyInitializer()
{
RegisteredObjects.AddConnection(typeof(ClickHouseDataConnection),"ClickHouse");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using ClickHouse.Client.ADO;
using ClickHouse.Client.Types;
using FastReport.Data;
using FastReport.Data.ConnectionEditors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastReport.ClickHouse
{
public partial class ClickHouseDataConnection
{
public override Type GetParameterType()
{
return typeof(ClickHouseTypeCode);
}
public override ConnectionEditorBase GetEditor()
{
return new ClickHouseConnectionEditor();
}
public override string GetConnectionId()
{
ClickHouseConnectionStringBuilder builder = new ClickHouseConnectionStringBuilder(ConnectionString);
string info = "";
try
{
info = builder.Database;
}
catch
{
}
return "ClickHouse: " + info;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using FastReport.Data.ConnectionEditors;
using FastReport.Forms;
using FastReport.Utils;
using ClickHouse.Client.ADO;

namespace FastReport.Data
{
public partial class ClickHouseConnectionEditor : ConnectionEditorBase
{
private string FConnectionString;
private void Localize()
{
//for now is empty.
}

protected override string GetConnectionString()
{
ClickHouseConnectionStringBuilder builder = new ClickHouseConnectionStringBuilder(FConnectionString);

builder.Username = tbUserName.Text;
builder.Host = tbServer.Text;
builder.Port = ushort.Parse(tbPort.Text);
builder.Password = tbPassword.Text;
builder.Database = tbDatabase.Text;

return builder.ToString();
}

protected override void SetConnectionString(string value)
{
FConnectionString = value;
ClickHouseConnectionStringBuilder builder = new ClickHouseConnectionStringBuilder(FConnectionString);
tbServer.Text = builder.Host;
tbUserName.Text = builder.Username;
tbPassword.Text = builder.Password;
tbDatabase.Text = builder.Database;
tbPort.Text = builder.Port.ToString();
}

public ClickHouseConnectionEditor()
{
InitializeComponent();
Localize();
}


}
}
Loading

0 comments on commit 572a836

Please sign in to comment.