加载水晶报告时出现闪烁问题 [英] Flickering Problem while loading crystal report

查看:98
本文介绍了加载水晶报告时出现闪烁问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在使用datagridview的数据加载水晶报告时出现了闪烁问题。当闪烁程序冻结,直到加载完成。我该如何解决这个问题?感谢您的帮助。

这是我的代码

 DataSet4 ds =  new  DataSet4(); 
DataTable t = ds.Tables.Add( stock);
t.Columns.Add( Item_Name,Type.GetType( System.String));
t.Columns.Add( Store,Type.GetType( System.String));
t.Columns.Add( Total_Stock,Type.GetType( System.String));
t.Columns.Add( Product_Code,Type.GetType( System.String));
t.Columns.Add( 其中,Type.GetType( System.String));

DataRow r;

string ItemName = string .Empty;
string sto = string .Empty;
string totostok = string .Empty;
string pcode = string .Empty;
string wich = string .Empty;

for int i = 0 ; i < dataGridView1.RowCount; i ++)
{
pcode = dataGridView1.Rows [i] .Cells [ 0 ]。Value.ToString();
ItemName = dataGridView1.Rows [i] .Cells [ 1 ]。Value.ToString();
sto = dataGridView1.Rows [i] .Cells [ 2 ]。Value.ToString();
totostok = dataGridView1.Rows [i] .Cells [ 3 ]。Value.ToString();
wich = cmbFilter.Text;

r = t.NewRow();
r [ Product_Code] = pcode;
r [ Item_Name] = ItemName;
r [ Store] = sto;
r [ Total_Stock] = totostok;
r [ 其中] = wich;
t.Rows.Add(r);

CrystalReport4 objRpt = new CrystalReport4();
objRpt.SetDataSource(ds.Tables [ 1 ]);
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Dock = DockStyle.Fill;
crystalReportViewer1.Refresh();
crystalReportViewer1.Show();
}

解决方案

我建​​议你添加以下元标记:



< meta http-equiv =   Page-输入 content =   blendTrans(Duration = 0) >  
< meta http-equiv = Page-Exit content = blendTrans(Duration = 0) >


覆盖表单的 create-param属性

< pre lang =C#> /// < 摘要 >
/ // 这个方法是为了避免在加载时间表时出现问题
/// < / summary >
/// < ; value > < / value >
/// < 返回 > < / returns >
/// < span class =code-summarycomment>< 备注 > < /备注 >
protected 覆盖 CreateParams CreateParams {
get {
CreateParams cp = base .CreateParams;
cp.ExStyle = cp.ExStyle | 0x2000000;
return cp;
}
}
// CreateParams



快乐编码!

:)


Hi,
I have a flickering problem while loading crystal report with data from a datagridview. And when flickering the program freezes until loading is complete. How can i resolve this problem?? Thank you for any help.
Here is my code

DataSet4 ds = new DataSet4();
DataTable t = ds.Tables.Add("stock");
t.Columns.Add("Item_Name", Type.GetType("System.String"));
t.Columns.Add("Store", Type.GetType("System.String"));
t.Columns.Add("Total_Stock", Type.GetType("System.String"));
t.Columns.Add("Product_Code", Type.GetType("System.String"));
t.Columns.Add("Which", Type.GetType("System.String"));

DataRow r;

string ItemName = string.Empty;
string sto = string.Empty;
string totostok = string.Empty;
string pcode = string.Empty;
string wich = string.Empty;

for (int i = 0; i < dataGridView1.RowCount; i++)
{
    pcode = dataGridView1.Rows[i].Cells[0].Value.ToString();
    ItemName = dataGridView1.Rows[i].Cells[1].Value.ToString();
    sto = dataGridView1.Rows[i].Cells[2].Value.ToString();
    totostok = dataGridView1.Rows[i].Cells[3].Value.ToString();
    wich = cmbFilter.Text;

    r = t.NewRow();
    r["Product_Code"] = pcode;
    r["Item_Name"] = ItemName;
    r["Store"] = sto;
    r["Total_Stock"] = totostok;
    r["Which"] = wich;
    t.Rows.Add(r);

    CrystalReport4 objRpt = new CrystalReport4();
    objRpt.SetDataSource(ds.Tables[1]);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Dock = DockStyle.Fill;
    crystalReportViewer1.Refresh();
    crystalReportViewer1.Show();
}

解决方案

I suggest you add the following meta tags:

<meta http-equiv="Page-Enter" content="blendTrans(Duration=0)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0)">


override create-param property of form,

/// <summary>
/// This method written for avoid flikering while loading timetable
/// </summary>
/// <value></value>
/// <returns></returns>
/// <remarks></remarks>
protected override CreateParams CreateParams {
    get {
        CreateParams cp = base.CreateParams;
        cp.ExStyle = cp.ExStyle | 0x2000000;
        return cp;
    }
}
//CreateParams


Happy Coding!
:)


这篇关于加载水晶报告时出现闪烁问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆