logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • Connection plugin for Cassandra from FastReport .NET
  • How to connect to OracleDB from FastReport .NET

    November 15, 2019

    First of all, you can use the ODBC connector. But it is fraught with a

    read more
  • Building libgdiplus library from source

    October 2, 2020

    When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating

    read more
  • How to connect to SQLCe

    November 11, 2019

    Microsoft SQL Server Compact Edition is a simple local relational database that doesn't require installation,

    read more
  • How to connect the IBM DB2 database in reports designer FastReport .NET

    November 15, 2019

    To connect the report to a DB2 database, you need to connect the plugin to

    read more
  • How to use Plugin Manager

    September 3, 2019

    FastReport .NET provides a plugin mechanism for extending the functionality of the report designer. Most

    read more

Connection plugin for Cassandra from FastReport .NET

August 18, 2022

Connection plugin for Cassandra from FastReport .NET

We are pleased to present you a new plug-in for configuring а connection to Cassandra, which is available for FastReport .NET, FastReport Core, FastReport CoreWin, FastReport OpenSource. Let’s note an important detail that the order of the records will be overset because of the CassandraCsDriver library used by this connection.

Cassandra — is а NoSQL distributed database system, which аllows to create highly scalable and reliable storages of huge data arrays in the form of a hash.

To use it, you must first build the project:

С:\Program Files (x86)\FastReports\FastReport.Net\Extras\Core\FastReport.Data\FastReport.Data.Cassandra

After building the project, you will need to add the plugin to the application in one of two ways:

1. Add plugin via designer:

Adding a Plugin

 

2. Add the plugin as a dependency when starting the project and register it in the code with the following command:

FastReport.Utils.RegisteredObjects.AddConnection(typeof(CassandraDataConnection));

To create a connection to Cassandra, you need to click on the "Data" tab in the designer, and select the "Add Data Source" item. Click on the "New Connection" in the resulting window. Specify the database address(es), key space, port, username, and password.

If there are no problems with access to the database, then a list of tables will appear after clicking the "Next" button. When connecting a table, you must check the box to the left of the table name. It will be possible to complete the connection only after that.

Connecting to Cassandra

 

Upon connecting the data source, you need to bind a band to it.

Report template connected to Cassandra

 

The final report will use data from the created connection to Cassandra.

Prepared report with data from connection to Cassandra

 

An example of connecting to Cassandra from code:

// Create an object CassandraDataConnection
var connection = new CassandraDataConnection();
// Create an object CassandraConnectionStringBuilder
CassandraConnectionStringBuilder stringBuilder = new CassandraConnectionStringBuilder();
// Configure аn object CassandraConnectionStringBuilder
stringBuilder.ContactPoints = new string[] { "localhost" };
stringBuilder.DefaultKeyspace = "uprofile1";
// Set the connection string
connection.ConnectionString = stringBuilder.ToString();
// Initialize all tables
connection.CreateAllTables();
// Set the connection name
connection.Name = "NewConnection";
//Creаte аn object Report
var report = new Report();
// Add a connection to the report
report.Dictionary.Connections.Add(connection);
// Enаble connection display
connection.Enabled = true;
// Select a table and connect it to the report
foreach (TableDataSource table in connection.Tables)
{
 table.Enabled = true;
}

After executing this code, we can see in the designer a new connection with the "user1" table in the list of available connections.

Data source added after the code execution

 

As you can see, it is now possible to create a connection to Cassandra and use the data stored there.

about product buy
avatar
Vladislav Yarovoy
.NET Development
Fast Reports Team: Vladislav Yarovoy - NET Development at Fast Reports
.NET FastReport Core Data Source Designer Open Source Plugin

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy