⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcg12.htm

📁 Visual C++与数据库的连接经典实例
💻 HTM
📖 第 1 页 / 共 5 页
字号:

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Returns the handle of the title string that is to appear on the title bar of the specified report when the report prints to a Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEGetSectionFormat

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Retrieves the section format settings for selected sections in the specified report and supplies them as member values for the PESectionOptions structure.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEGetSelectedPrinter

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Retrieves information about a nondefault printer if one is specified in the report.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEGetSQLQuery

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Retrieves the handle for the string containing the SQL query generated by the specified report.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEHasSavedData

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Queries a report to find if data is saved with it.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEPrintControlsShowing

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Checks whether the print controls are displayed in the Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetFont

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the font for field and/or text characters in the specified report section(s).

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetGroupCondition

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Changes the group condition for a group section.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetLineHeight

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the line height and ascent for a specified line in a selected section of the report.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetMargins

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the page margins for the specified report to the values you supply as parameters.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetMinimumSectionHeight

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the minimum height for specified report sections to the value supplied as a parameter.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetNDetailCopies

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Prints multiple copies of the Details section of the report.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetNthParam

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the value of a parameter in a stored procedure.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetPrintOptions

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the print options for the report to the values supplied in the PEPrintOptions structure.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetReportTitle

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Changes the Preview window title to the title string you supply as a parameter.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetSectionFormat

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Sets the section format settings for selected sections in the specified report to the values in the PESectionOptions structure.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PESetSQLQuery

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Changes the SQL query to the query string you supply as a parameter.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEShowNextPage

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the next page in the Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEShowFirstPage

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the first page in the Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEShowPreviousPage

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the previous page in the Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEShowLastPage

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the last page in the Preview window.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

PEShowPrintControls

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the print controls.</FONT>

</TABLE></CENTER><P>You can include Crystal Reports Pro in a Visual C++ project using the same techniques that you would use to include Crystal Reports for Visual C++. Many applications will do just fine using Crystal Reports for Visual C++, but mainstream applications will benefit from Crystal Reports Pro's increased functionality.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Crystal maintains a flexible licensing policy for developers who need to include Crystal Report's report generator module with their applications. Contact Crystal at (604) 681-3435 and talk to one of their OEM account managers. See Appendix A, &quot;Resources for Developing Visual C++ Database Applications,&quot; for more information about Crystal.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E70"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Using ReportEase with Visual C++ Applications</B></FONT></CENTER></H3>

<BR>

<P>The ReportEase program is installed as a DLL that can be called from your own applications. You also have the option of simply including the ReportEase source code with your application if you don't want to ship separate DLL files. One of the best features of ReportEase is that it's supplied with full source code, which lets developers make modifications to enhance the program's usability with the calling application. Also, you can fix those little annoying bugs that are often found in third-party applications.

<BR>

<P>As this book was being written, Sub Systems announced version 2.5 of ReportEase. This new version sports a number of new functionalities:

<BR>

<UL>

<LI>Support for multiple instances. The form designer and report generator may be executed at the same time.

<BR>

<BR>

<LI>Reports may now be saved to files in addition to being printed or sent to the screen.

<BR>

<BR>

<LI>An improved print preview facility is included.

<BR>

<BR>

<LI>Improvements to ReportEase's clipboard support.

<BR>

<BR>

<LI>General improvements in ReportEase's performance.

<BR>

<BR>

</UL>

<P>Due to the fact that the new version of ReportEase wasn't available for review, this chapter discusses the earlier version.

<BR>

<P>This section of the chapter looks at the interface that ReportEase uses. You will also see examples of the code that is necessary to call ReportEase from a Windows application. The calling program in this instance is STARmanager, a sales territory GIS management system. STARmanager is a commercial Windows application available from

<BR>

<UL>

<UL>

<P>TTG Inc.

</UL></UL>

<UL>

<UL>

<P>10 State Street

</UL></UL>

<BLOCKQUOTE>

<BLOCKQUOTE>

<P>Woburn, MA 01801

<BR>

</BLOCKQUOTE></BLOCKQUOTE>

<P>ReportEase is designed to accept records from one or more logical files or sources. These records don't need to be kept in separate disk files, because when the report printer is run, your interface will supply the necessary data to the ReportEase report printer module.

<BR>

<P>Using ReportEase is a two-step process. First you must create a report (using the form editor), and then you can print it. You use the report printer to print either to the screen or to a printer. You must supply some common support routines. It's easy to actually incorporate ReportEase&#151;the initial inclusion usually takes only a few hours.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Because including ReportEase with a Visual C++ 4 project requires programming that is specific to each application, the source files in this part of the chapter are for example only. Your own implementation may vary significantly.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E69E193"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Creating Reports with ReportEase</B></FONT></CENTER></H4>

<BR>

<P>When you use ReportEase, the first interface you need to create is the form editor interface. Listing 12.15 shows an example of the code that calls the form generator from a C++ application. All the examples in the ReportEase documentation are for C programs; however, ReportEase can be used with both C and C++ programs.

<BR>

<P>

<FONT COLOR="#000080"><B>Listing 12.15. Calling the ReportEase form generator.</B></FONT>

<BR>

<PRE>

<FONT COLOR="#000080">/*  REPORTS.C */

#define  HAVEREPORT

#include &quot;stdafx.h&quot;

#include &quot;STAR.H&quot;

#include &lt;time.h&gt;

#include &lt;stdio.h&gt;

#include &lt;stdlib.h&gt;

#include &lt;string.h&gt;

#include &lt;io.h&gt;

#define REP_CPLUSPLUS extern &quot;C&quot;

#include &quot;rep\rep.h&quot;

#include &quot;reportco.h&quot;

/******************************************************************************

**

**      TITLE: REPSYS.cpp

**

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -