<small id='8yWvQ'></small><noframes id='8yWvQ'>

  • <tfoot id='8yWvQ'></tfoot><legend id='8yWvQ'><style id='8yWvQ'><dir id='8yWvQ'><q id='8yWvQ'></q></dir></style></legend>

        <i id='8yWvQ'><tr id='8yWvQ'><dt id='8yWvQ'><q id='8yWvQ'><span id='8yWvQ'><b id='8yWvQ'><form id='8yWvQ'><ins id='8yWvQ'></ins><ul id='8yWvQ'></ul><sub id='8yWvQ'></sub></form><legend id='8yWvQ'></legend><bdo id='8yWvQ'><pre id='8yWvQ'><center id='8yWvQ'></center></pre></bdo></b><th id='8yWvQ'></th></span></q></dt></tr></i><div id='8yWvQ'><tfoot id='8yWvQ'></tfoot><dl id='8yWvQ'><fieldset id='8yWvQ'></fieldset></dl></div>
          <bdo id='8yWvQ'></bdo><ul id='8yWvQ'></ul>

        如何在 Crystal Report 中显示打印对话框?

        时间:2023-07-09

            <legend id='npRTi'><style id='npRTi'><dir id='npRTi'><q id='npRTi'></q></dir></style></legend>
          1. <tfoot id='npRTi'></tfoot>
              <i id='npRTi'><tr id='npRTi'><dt id='npRTi'><q id='npRTi'><span id='npRTi'><b id='npRTi'><form id='npRTi'><ins id='npRTi'></ins><ul id='npRTi'></ul><sub id='npRTi'></sub></form><legend id='npRTi'></legend><bdo id='npRTi'><pre id='npRTi'><center id='npRTi'></center></pre></bdo></b><th id='npRTi'></th></span></q></dt></tr></i><div id='npRTi'><tfoot id='npRTi'></tfoot><dl id='npRTi'><fieldset id='npRTi'></fieldset></dl></div>
                <tbody id='npRTi'></tbody>

                <bdo id='npRTi'></bdo><ul id='npRTi'></ul>

                • <small id='npRTi'></small><noframes id='npRTi'>

                  本文介绍了如何在 Crystal Report 中显示打印对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将我的 Crystal 报告 直接打印到打印机.目前我正在导出到 PDF.但我的客户希望它直接进入打印机.如何在单击打印按钮时显示 Print Dialog 以将报告直接打印到打印机.

                  I want to print my Crystal report direct to the printer. Currently I am having the export to PDF. But my client want this to go to Printer directly. How can I show the Print Dialog on click of Print Button to Print the report directly to Printer.

                  我想提一下:我正在为我的项目使用 C# 和 asp.net.

                  I would like to mention: I am using C# and asp.net for my project.

                  谢谢.

                  推荐答案

                  试试下面的代码

                      private void Button1_Click(object sender, EventArgs e)
                      {
                          CrystalReport1 report1 = new CrystalReport1();
                          PrintDialog dialog1 = new PrintDialog();
                  
                          report1.SetDatabaseLogon("username", "password");
                  
                          dialog1.AllowSomePages = true;
                          dialog1.AllowPrintToFile = false;
                  
                          if (dialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                          {
                              int copies = dialog1.PrinterSettings.Copies;
                              int fromPage = dialog1.PrinterSettings.FromPage;
                              int toPage = dialog1.PrinterSettings.ToPage;
                              bool collate = dialog1.PrinterSettings.Collate;
                  
                              report1.PrintOptions.PrinterName = dialog1.PrinterSettings.PrinterName;
                              report1.PrintToPrinter(copies, collate, fromPage, toPage);            
                          }
                  
                          report1.Dispose();
                          dialog1.Dispose();
                      }
                  

                  您必须使用数据库的凭据更改用户名"和密码".

                  you will have to change the "username" and the "password" with the credentials of your database.

                  编辑

                  此代码仅可用于服务器端打印.

                  这篇关于如何在 Crystal Report 中显示打印对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我可以修改 Request.Headers 集合吗? 下一篇:如何在水晶报表中向子报表发送参数

                  相关文章

                  <i id='yG1rJ'><tr id='yG1rJ'><dt id='yG1rJ'><q id='yG1rJ'><span id='yG1rJ'><b id='yG1rJ'><form id='yG1rJ'><ins id='yG1rJ'></ins><ul id='yG1rJ'></ul><sub id='yG1rJ'></sub></form><legend id='yG1rJ'></legend><bdo id='yG1rJ'><pre id='yG1rJ'><center id='yG1rJ'></center></pre></bdo></b><th id='yG1rJ'></th></span></q></dt></tr></i><div id='yG1rJ'><tfoot id='yG1rJ'></tfoot><dl id='yG1rJ'><fieldset id='yG1rJ'></fieldset></dl></div>
                • <small id='yG1rJ'></small><noframes id='yG1rJ'>

                  • <bdo id='yG1rJ'></bdo><ul id='yG1rJ'></ul>

                    <legend id='yG1rJ'><style id='yG1rJ'><dir id='yG1rJ'><q id='yG1rJ'></q></dir></style></legend>
                  1. <tfoot id='yG1rJ'></tfoot>