Interface IConnectionsService
Interface for working with connections. Allows to get connection string properties, connected tables, connection types and create a connection string.
Namespace: FastReport.Web.Services
Assembly: FastReport.OpenSource.Web.dll
Syntax
public interface IConnectionsService
Remarks
The interface may change over time
Methods
CreateConnection(WebReport, String, CreateConnectionParams)
Declaration
void CreateConnection(WebReport webReport, string connectionType, CreateConnectionParams params)
Parameters
Type | Name | Description |
---|---|---|
WebReport | webReport | |
System.String | connectionType | |
CreateConnectionParams | params |
CreateConnectionStringJSON(String, IFormCollection, out Boolean)
Create connection string and returns json with this connection string
Declaration
string CreateConnectionStringJSON(string connectionType, IFormCollection form, out bool isError)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionType | |
Microsoft.AspNetCore.Http.IFormCollection | form | |
System.Boolean | isError | Out variable, which helps to determine if an error is returned |
Returns
Type | Description |
---|---|
System.String | Returns JSON with сonnection string. If an error is detected, it returns the error text. |
GetConnectionStringPropertiesJSON(String, String, out Boolean)
Returns JSON string of connection string properties.
Declaration
string GetConnectionStringPropertiesJSON(string connectionType, string connectionString, out bool isError)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionType | |
System.String | connectionString | |
System.Boolean | isError | Out variable, which helps to determine if an error is returned |
Returns
Type | Description |
---|---|
System.String | Returns JSON string with connection string properties. If an error is detected, it returns the error text. |
GetConnectionTables(WebReport, String, String, List<CustomViewModel>)
Returns the list of connected tables by connection type and connection string
Declaration
string GetConnectionTables(WebReport webReport, string connectionType, string connectionString, List<CustomViewModel> customConnections)
Parameters
Type | Name | Description |
---|---|---|
WebReport | webReport | |
System.String | connectionType | |
System.String | connectionString | |
System.Collections.Generic.List<CustomViewModel> | customConnections |
Returns
Type | Description |
---|---|
System.String | Returns JSON with connected tables |
GetConnectionTables(String, String, List<CustomViewModel>)
Returns the list of connected tables by connection type and connection string
Declaration
string GetConnectionTables(string connectionType, string connectionString, List<CustomViewModel> customConnections)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionType | |
System.String | connectionString | |
System.Collections.Generic.List<CustomViewModel> | customConnections |
Returns
Type | Description |
---|---|
System.String | Returns JSON with connected tables |
GetConnectionTypes(Boolean)
Returns the list of connection types
Declaration
Dictionary<string, object> GetConnectionTypes(bool needSqlSupportInfo = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | needSqlSupportInfo |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
GetParameterTypes(String, out String)
Returns the list of parameter types by connection type.
Declaration
Dictionary<string, int> GetParameterTypes(string connectionType, out string errorMsg)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionType | The type of connection. |
System.String | errorMsg | Error message. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Int32> |
GetUpdatedTableByConnectionString(WebReport, String, String, UpdateTableParams)
Updates a table within a database using the provided connection string and parameters.
Declaration
string GetUpdatedTableByConnectionString(WebReport webReport, string connectionString, string connectionType, UpdateTableParams parameters)
Parameters
Type | Name | Description |
---|---|---|
WebReport | webReport | The WebReport object containing the table to be updated. |
System.String | connectionString | The connection string to the database. |
System.String | connectionType | The type of connection. |
UpdateTableParams | parameters | The parameters specifying the table name, SQL query, and update parameters. |
Returns
Type | Description |
---|---|
System.String | A string representation of the updated table. |
GetUpdatedTableByReportId(WebReport, UpdateTableParams)
Updates a table within a web report based on the provided parameters.
Declaration
string GetUpdatedTableByReportId(WebReport webReport, UpdateTableParams parameters)
Parameters
Type | Name | Description |
---|---|---|
WebReport | webReport | The WebReport object containing the table to be updated. |
UpdateTableParams | parameters | The parameters specifying the table name, SQL query, and update parameters. |
Returns
Type | Description |
---|---|
System.String | A string representation of the updated table. |