コード例 #1
0
ファイル: PdfReport.cs プロジェクト: compwron/ljarchive-code
        //------------------------------------------------------------------------------------------07.02.2006
        /// <summary>Shows the specified PDF document in a maximized window after that it has been created.</summary>
        /// <param name="sFileName">File name of the new PDF document</param>
        /// <exception cref="ReportException">
        /// The acrobat reader has not been installed, the registry entry is invalid or the reader cannot be started.
        /// </exception>
        /// <remarks>
        /// This method will create the specified PDF document.
        /// If the file name is relative, the file will be created in the current user's temporary folder.
        /// If it exists, the name of the file will be made unique with a time stamp.
        /// If the specified file name is absolute, it will be overwritten if it exists.
        /// After that the document will be displayed in the acrobat reader in a maximized window.
        /// </remarks>
        /// <example>
        /// <code>
        /// public class MyReport : Report {
        ///   public static void Main() {
        ///     PdfReport<MyReport> pdfReport = new PdfReport<MyReport>();
        ///     pdfReport.pageLayout = PageLayout.TwoColumnLeft;
        ///     pdfReport.View("MyReport.pdf");
        ///   }
        ///
        ///   protected override void Create() {
        ///     FontDef fd = new FontDef(this, FontDef.StandardFont.Helvetica);
        ///     FontProp fp = new FontPropMM(fd, 20);
        ///     new Page(this);
        ///     page_Cur.AddCB_MM(80, new RepString(fp, "My Report"));
        ///   }
        /// }
        /// </code>
        /// </example>
        public void View(String sFileName)
        {
            ReportClass report = new ReportClass();

            report.formatter = this;
            RT.ViewPDF(report, sFileName);
        }