Fastreport a custom Data set

Source: Internet
Author: User

1. You can customize a new data source

Reference:

Internal class Virtualdatasource:datasourcebase
{
private int fvirtualrowscount;

public int Virtualrowscount
{
get {return fvirtualrowscount;}
set {Fvirtualrowscount = value;}
}

#region Protected Methods
<inheritdoc/>
protected override object GetValue (column column)
{
return null;
}
#endregion

#region Public Methods
public override void Initschema ()
{
Do nothing
}

public override void LoadData (ArrayList rows)
{
Rows. Clear ();
for (int i = 0; i < Fvirtualrowscount; i++)
{
Rows. ADD (0);
}
}
#endregion
}

2, can inherit Tabledatasource modify LoadData method.

3, want to visual design, must inherit dataconnectionbase to implement the corresponding method.

public override string[] Gettablenames ()

public override string Quoteidentifier (string value, DbConnection connection)

public override Type Getconnectiontype ()

public override DbDataAdapter Getadapter (string SelectCommand, DbConnection connection,
Commandparametercollection parameters)

<inheritdoc/>
public override Connectioneditorbase Geteditor ()
{
return new Mssqlconnectioneditor ();
}

<inheritdoc/>
public override Type Getparametertype ()
{
Return typeof (SqlDbType);
}

<inheritdoc/>
public override int Getdefaultparametertype ()
{
return (int) SqlDbType.VarChar;
}

<inheritdoc/>
public override string GetConnectionID ()
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder (ConnectionString);
string info = Builder. InitialCatalog;
if (String.IsNullOrEmpty (info))
info = Builder. AttachDbFileName;
Return "MS SQL:" + info;
}
}

Fastreport a custom Data set

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.