fastReport 关闭对话框以及进度条

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/huiquan346950757/article/details/51783494

在项目研发过程中使用到了fastreport,但是fastreport在打印的时候会先弹出打印对话框,再弹出打印进度条,为了去掉这两个,特意在文章中备注,方便后面查找!也希望能够给大家带来一点帮助!

    (1)去掉打印对话框:

           打印对话框属于报表的打印属性,因此直接设置其属性即可,代码如下:

            Report FReport = new Report();

            FReport.PrintSettings.ShowDialog=false;  

   (2)去掉打印进度条:

             属性的设置在报表的环境变量设置中设置(每次只设置一次),具体代码如下:

public static FastReport.EnvironmentSettings eSet = new EnvironmentSettings();  

eSet.ReportSettings.ShowProgress = false;


展开阅读全文

对话框关闭

08-04

top.aspx中有个按钮是 rn当我在这个页面点击button1时 rnButton1.Attributes.Add("onClick", "window.showModalDialog(\"showModalDialog.aspx\",\"\",\"dialogWidth:400px;dialogHeight:400px\");"); rnshowModalDialog。cs是:rnusing System;rnusing System.Data;rnusing System.Configuration;rnusing System.Collections;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.Collections.Generic;rnrnpublic partial class test : System.Web.UI.Pagernrn Hashtable ht;rnrn protected void Page_Load(object sender, EventArgs e)rn if (!Page.IsPostBack)rn ht = new Hashtable();rn ViewState["ht"] = ht;rn rnrn rn rn protected void Button_Click(object sender, EventArgs e)rn ht= (Hashtable)ViewState["ht"];rn foreach (ListItem i in ListBox1.Items) rn if (i.Selected == true)rn ListBox2.Items.Add(i.Text);rn ht.Add(i.Text.ToString(), i.Value.ToString());rn rn rnrn int[] indexToDel = ListBox1.GetSelectedIndices(); //取得所有选取值的index集合rn int cnt = indexToDel.Length;rn for (int i = cnt - 1; i >= 0; i--) rn ListBox1.Items.RemoveAt(indexToDel[i]);rnrn rnrn protected void Button2_Click(object sender, EventArgs e)rnrn ht = (Hashtable)ViewState["ht"];rn int[] indexToDel = ListBox2.GetSelectedIndices(); //取得所有选取值的index集合rn int cnt = indexToDel.Length;rn foreach(ListItem i in ListBox2.Items)rn if (i.Selected == true) rn ht.Remove(i.Text.ToString());rn rnrn for (int i = cnt - 1; i >= 0; i--)rn ListBox2.Items.RemoveAt(indexToDel[i]);rn rn rnrn protected void Button3_Click(object sender, EventArgs e)rn ht = (Hashtable)ViewState["ht"];rn Application["ht"] = ht;rn rn Response.Redirect("right_top.aspx");rn rn rn rnrnrnrnshowModalDialog.aspx有个Button3_Click按钮当我点击一个按钮时,转发另个个页面,并且对话框关闭,怎么解决? 论坛

进度条的开启和关闭问题

03-13

想要的结果是:删除列表中的第n条记录时,显示进度条,删除完毕并作相应处理后关闭进度条。但我如下做法却实现不了。具体是:用ApplicationBar中的按钮(如btnBegin、btnEnd)可实现进度条的开启和关闭,但在ListBox中的按钮(如deleteTaskButton_Click)却不能实现进度条的开启和关闭。个人感觉是ListBox中的按钮调用不了其外面的控件progressBar,我也不知道如何调用。请高手指点。rnrn/*页面部分代码*/rn rn rn rn rn rn rn rn rn rn rn rnrn rnrn rnrn rn rn rn rn rn rnrnrn/*后台可实现进度条开启和关闭的部分代码*/rnrn private void btnBegin(object sender, EventArgs e)rn rn progressBar.ShowProgress = true;rn rnrnrn private void btnEnd(object sender, EventArgs e)rn rn progressBar.ShowProgress = false;rn rnrnrn/*后台不能实现进度条开启和关闭的部分代码,下面的按钮在temTemplate="StaticResource PrincipleContentTemplate" 中已定义*/rnrnrn private void deleteTaskButton_Click(object sender, RoutedEventArgs e)rn rnrn var button = sender as Button;rnrn if (button != null)rn rnrn if (MessageBox.Show(" 真的要删除吗?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)rn rn progressBar.ShowProgress = true; //进度条开始rnrn rn for (int i = 0; i < 100000; i++)rn rn for (int j = 0; j < 100000; j++)rn rn rn rnrn progressBar.ShowProgress = false; //进度条结束rnrn rn rn rnrn 论坛

没有更多推荐了,返回首页