General information
Category:
Reports & Report designer
The problem may have to do with printer driver\printer information. I got a tip a while back that foxpro reports store printer information (at the time their created) inside the *.frx file. It has helped me since to do the following:
1) Don't include forms in the project (so they are not read only).
2) As part of the code to print the report..."Clean" out the EXPR, TAG, and TAG2 fields within the *.frx just prior to printing report.
I've enclosed the code I use to do this...immediately below is the code to call a function to clear fields, then print report. Lower down, is the functin itself.
Hope this helps - Victor
*******************************
*- Code to clear *.frx and run report:
llSuccess = fnReportClean("MyReportFileName")
IF !llSuccess
= MESSAGEBOX("If report is unreadable, please contact administrator.")
ENDIF
REPORT FORM MyReportFileName TO PRINTER PROMPT NOCONSOLE PREVIEW
*- End of code for printing report
***********************************
FUNCTION fnReportClean
PARAMETER lcReportName
PRIVATE lcCurAlias, lcCurError
*- This function replaces first row of .FRX table (fields
*- EXPR, TAG, TAG2) with blanks to remove specific printer info.
IF EMPTY(lcReportName)
RETURN .F.
ENDIF
IF EMPTY(JUSTEXT(lcReportName)) ;
OR UPPER(JUSTEXT(lcReportName)) <> "FRX"
lcReportName = ALLT(lcReportName) + ".FRX"
ENDIF
lcCurAlias = ALIAS()
lcCurError = ON('error')
ON ERROR RETURN UhhOhh(lcCurError, lcCurAlias)
SELE 0
USE &lcReportName ALIAS RptName
GO 1
REPLACE expr WITH "", tag WITH "", tag2 WITH ""
ON ERROR &lcCurError
DO fnReportCleanCleanUp
RETURN .T.
PROCEDURE UhhOhh
PARAMETER lcCurError, lcCurAlias
ON ERROR &lcCurError
DO fnReportCleanCleanUp
RETURN .F.
PROCEDURE fnReportCleanCleanUp
ON ERROR &lcCurError
IF USED('RptName')
USE IN RptName
ENDIF
IF !EMPTY(lcCurAlias)
SELE &lcCurAlias
ENDIF
RETURN
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only