SaveAs, report without preview ?

Post Reply
User avatar
Matheusfarias
Posts: 17
Joined: Mon Sep 10, 2012 1:55 pm
Location: João Pessoa/Paraiba/Brasil
Contact:

SaveAs, report without preview ?

Post 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?
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: SaveAs, report without preview ?

Post 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
Regards

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: SaveAs, report without preview ?

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: SaveAs, report without preview ?

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: SaveAs, report without preview ?

Post by James Bott »

OK, so I am going to have to modify the report class to prevent the dialog from being displayed?

Regards,
James
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: SaveAs, report without preview ?

Post 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).
Regards

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: SaveAs, report without preview ?

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: SaveAs, report without preview ?

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: SaveAs, report without preview ?

Post 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
Post Reply