Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: 567 Page Header or Footer longer than a page

Status
Not open for further replies.

dragonlips

Programmer
Aug 30, 2001
7
US
I have a report that is supposed to print to a label printer. The report is saved with the label printer driver and I make sure the clients have the label printer driver installed as well. (same driver) I can run the report fine in the designer as well as in debug mode within my application. However when I compile a release version and push it out to the clients (or even run it on my machine again) it fails with Error: 567.

I have had this error before and it was a result of sections being to big etc. etc. I have tried everything on this label and I know it's not to big but I still receive the error.

Has anyone ever had a similar issue?

Marc



 
Ok I've decided to add more information since no one is responding.

Below is a copy of my object method that sets the printer for the current report. The printer is a custom object and already has the DEVMODE struct for the printer we want to print to. As you can see I pull the saved printer information (if there is any) and set the relevant values to the printer we've passed in and then set the printer on the repot.

Anyone?

// printer - in: A CNCPrinter pointer to allow the user to specify the printer outside of the report engine
// and just pass in the CNCPrinter object. Makes manipulation easier
void CRObj::setPrinter(CNCPrinter *printer)
{
if (getReportState() == CLOSED)
OpenReport();

if (getReportState() == OPEN ||
getReportState() == CONNECTED)
{
HANDLE driverHandle;
short driverLength;
HANDLE printerHandle;
short printerLength;
HANDLE portHandle;
short portLength;
DEVMODE *pd;

if(!PEGetSelectedPrinter(m_PrintHandle, &driverHandle, &driverLength, &printerHandle, &printerLength, &portHandle, &portLength, &pd))
_err(CNCException::ERR_CRP_LOGIN);

if(pd != NULL)
{
printer->getDEVMODE()->dmOrientation = pd->dmOrientation;
printer->getDEVMODE()->dmPaperSize = pd->dmPaperSize;
printer->getDEVMODE()->dmPaperLength = pd->dmPaperLength;
printer->getDEVMODE()->dmPaperWidth = pd->dmPaperWidth;
printer->getDEVMODE()->dmScale = pd->dmScale;
}

if(!PESelectPrinter(m_PrintHandle, printer->getDriver().GetBuffer(0), printer->getPrinterName().GetBuffer(0), printer->getPort().GetBuffer(0), static_cast<LPDEVMODE>(printer->getDEVMODE())))
_err(CNCException::ERR_CRP_LOGIN);
m_PrinterSet = true;
}
else
m_PrinterSet = false;
}
 
This was a response I got from CrystalDecisions email support. Seems to take care of it.



This EMail was sent: 12/17/2002 2:33:43 PM (Pacific Standard Time)

*** Response to your question - CTL:20021206-10075 ***

Whenever you send mail to the Answers By Email Service for this Technical
Request you MUST include the 'CTL:' and your Control Number in the Subject
Line.

You may send more information about this Technical Request at any time -
just make sure your Control Number is in the Subject line.

------------------------------------------------------------------------

Response To: Marc Caron

Hello Marc,

Thanks for your reply.

Looking at your code, it looks like you are missing the dmfields property
of the DEVMode structure.

Taken from the crystaldevhelp.chm file:

DWORD dmFields;
union {
struct {
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
};


Specifies which of the remaining members in the DEVMODE structure have
been initialized. Bit 0 (defined as DM_ORIENTATION) corresponds to
dmOrientation; bit 1 (defined as DM_PAPERSIZE) specifies dmPaperSize, and
so on. A printer driver supports only those members that are appropriate
for the printer technology.

Here is some sample code in VB:

myDevMode.dmFields = DM_PAPERSIZE + DM_PAPERLENGTH + DM_PAPERWIDTH

C++:

myDevmode.dmFields = (DM_ORIENTATION | DM_PAPERSIZE | DM_COPIES |
DM_DEFAULTSOURCE | DM_PRINTQUALITY | DM_TTOPTION);

Let me know if this helps.

Regards,
Choymann | Custom Applications Team | Crystal Decisions
Tech ID: 806
Access. Analyze. Report. Share
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top