dragonlips
Programmer
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 Page Header or Footer longer than a page.
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.
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;
}
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.
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;
}