本文整理汇总了C#中XtraReport.ShowPreviewDialog方法的典型用法代码示例。如果您正苦于以下问题:C# XtraReport.ShowPreviewDialog方法的具体用法?C# XtraReport.ShowPreviewDialog怎么用?C# XtraReport.ShowPreviewDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XtraReport
的用法示例。
在下文中一共展示了XtraReport.ShowPreviewDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPreview
//http://documentation.devexpress.com/#corelibraries/clsDevExpressXtraPrintingProgressReflectortopic
public static void ShowPreview(XtraReport report)
{
// Create a form to show a progress bar,
// and adjust its properties.
Form form = new Form();
form.FormBorderStyle = FormBorderStyle.None;
form.Size = new System.Drawing.Size(300, 25);
form.ShowInTaskbar = false;
form.StartPosition = FormStartPosition.CenterScreen;
form.TopMost = true;
// Create a ProgressBar along with its ReflectorBar.
ProgressBarControl progressBar = new ProgressBarControl();
ReflectorBar reflectorBar = new ReflectorBar(progressBar);
// Add a progress bar to a form and show it.
form.Controls.Add(progressBar);
progressBar.Dock = DockStyle.Fill;
form.Show();
try
{
// Register the reflector bar, so that it reflects
// the state of a ProgressReflector.
report.PrintingSystem.ProgressReflector = reflectorBar;
report.CreateDocument();
}
finally
{
// Unregister the reflector bar, so that it no longer
// reflects the state of a ProgressReflector.
report.PrintingSystem.ResetProgressReflector();
form.Close();
form.Dispose();
}
// Show the preview of the created document.
report.ShowPreviewDialog();
}
示例2: iBaoCao_ItemClick
private void iBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
XtraReport r = new XtraReport();
r.Landscape = true;
ReportBuilderHelper rbh = new ReportBuilderHelper();
if(ReportList == null) { MessageBox.Show("Chọn danh sách đã!"); return; }
rbh.Header = "Danh sách " + CurrentMDI.GetName();
rbh.GenerateReport(r, ReportList, CurrentMDI.GetType());
r.ShowPreviewDialog();
}
示例3: ShowPreview
/// <summary>
/// 显示打印预览
/// </summary>
/// <param name="reportClass">报表类</param>
/// <param name="data">填充数据</param>
/// <param name="tableName">填充的数据表名称</param>
public static void ShowPreview(XtraReport reportClass, DataSet data, string tableName)
{
if (reportClass == null) return;
//如果包含填充数据则将数据绑定到报表
reportClass.DataSource = data;
reportClass.DataMember = tableName;
reportClass.PrinterName = GetDefaultPrinter();
reportClass.PrintingSystem.ShowMarginsWarning = false;
//#region 直接打印
//for (int i = 0; i < 2; i++)
//{
// reportClass.PaperKind = System.Drawing.Printing.PaperKind.Custom;
// reportClass.Print();
//}
//#endregion
reportClass.ShowPreviewDialog();
}