Page 1 of 1
SaveAs, report without preview ?
Posted: Thu May 09, 2013 4:58 pm
by Matheusfarias
I want to create the PDF directly with the SaveAs FiveWin, after making the report of the dps EndPrint use saveas, how to operate?
Re: SaveAs, report without preview ?
Posted: Sat May 11, 2013 10:34 pm
by nageswaragunupudi
if you are using FWH13.04, you can use
PRINT oPrn FILE "filename.pdf"
In case of REPORTs, first create oPrn as above and then use REPORT command DEVICE oPrn
In case of earlier versions, this would help.
http://forums.fivetechsupport.com/viewt ... =6&t=26133
Re: SaveAs, report without preview ?
Posted: Sat May 18, 2013 4:17 pm
by James Bott
Rao,
I tried your suggestion and it does work, however, it also flashes a message box on the screen but it vanishes too fast for me to see it. I would like to eliminate this. Any ideas?
Below is my test code.
I am using FWH 13.04 under XP Pro SP3.
Regards,
James
Code: Select all
#include "FiveWin.ch"
#include "report.ch"
request DBFCDX
STATIC oReport
Function Rep01()
LOCAL oPrn, oReport
USE TEST NEW VIA "DBFCDX"
Print oPrn FILE "report.pdf"
REPORT oReport TITLE "*** My First Report ***" TO DEVICE oPrn
COLUMN TITLE "St" DATA Test->State
COLUMN TITLE "First Name" DATA Test->First
COLUMN TITLE " Salary" DATA Test->Salary
END REPORT
oReport:CellView()
ACTIVATE REPORT oReport
CLOSE TEST
RETURN NIL
Re: SaveAs, report without preview ?
Posted: Sun May 19, 2013 1:26 am
by nageswaragunupudi
it also flashes a message box on the screen but it vanishes too fast for me to see it.
It is the usual dialog we always see with page numbers being incremented while pages are being printed or preview pages are being generated.
It just flashed because the report was small. You would have seen it clearly in case of a long report.
Re: SaveAs, report without preview ?
Posted: Sun May 19, 2013 1:46 pm
by James Bott
OK, so I am going to have to modify the report class to prevent the dialog from being displayed?
Regards,
James
Re: SaveAs, report without preview ?
Posted: Sun May 19, 2013 1:59 pm
by nageswaragunupudi
If you think about it again, you will appreciate that this dialog is necessary ( or atleast very much desirable).
For longer reports (real life situations in an application) user needs some visual indication that the report generation (in this case pdf generation) is in progress. Otherwise the user has no clue as to what is happening and the application appears to be doing nothing.
If you still want to remove it you need to modify the Activate method of report class (towards the end, you can find DEFINE DIALOG ::oRepWnd).
Re: SaveAs, report without preview ?
Posted: Sun May 19, 2013 3:15 pm
by James Bott
Rao,
Yes, I agree with you, however, most of my reports are one page and are going directly to email so there isn't much of a delay. I am considering a progress bar in the status bar instead of the center screen dialog.
Also, whenever I see a long report I have to wonder if it can be shorter. A long report indicates to me the the users haven't yet figured out what information they really want. Once we can that defined then one page usually is enough.
Thanks for your reply.
Regards,
James
Re: SaveAs, report without preview ?
Posted: Sun May 19, 2013 11:48 pm
by nageswaragunupudi
One simple improvement can be that the dialog be made visible if the report is going more than say two pages.
In the generic report class, progress bar may be difficult, because report class does not know in advance how many pages will be printed. Actually report class does not know the datasource and it navigates only in forward direction.
But such customisations are possible for individual programmers because they know what kind of data they are dealing with.
Re: SaveAs, report without preview ?
Posted: Mon May 20, 2013 12:02 am
by James Bott
Rao,
I forgot about the pages issue. One possibility is a back-and-forth bar just to show it is busy. I will have to do some more thinking on this.
Thanks for the suggestions.
James