Printing 4GL reports in NewEra
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I'm trying to migrate 4gl reports to NewEra (non-VPP reports) using the Windows APIs. In 4gl we have escape codes for each printer that are 'printed' in the report. The idea now is to support escape codes for each Windows printer and print with effects like bold, italic,... 1.- Anyone has experimented with something like this? 2.- Is there any library for this, or similar, purpose? 3.- How can I make a Print Preview with effects (bold, italic, etc.)? 4.- I'm using the Windows API's PrinterDlg function (all in 4GL with C-code), but I can't obtain the device name and port selected in that dialog. I want to do something like this (I must say that my VC++ knowledge isn't high): FUNCTION print_dlg (...) VARIABLE devname, port CHAR(*) BEGIN_C static PRINTDLG pd; ... pd.lStructSize = sizeof(PRINTDLG); ... result = PrintDlg(&pd); END_C IF result = 0 THEN RETURN false, "", "" ELSE BEGIN_C --> Obtain the Device Name and Port selected RETURN true, devname, port END_C END IF END FUNCTION To get the DeviceName is posible acceding to pd.hDevNames, but it is a CString, and this involve the use of MFC. I think that with something like this: char buff(64) char* dname = (char*) pd.hDevNames; strcpy(dname, buff) return buff I can return the DevName like a char, but how can I obtain the port, and how can I use this with NE code?. Can you help me with this, or give your ideas and experieces in this subject? Thanks in advance. Sorry if there're errors in the code, I'm in home.