SaveAs, report without preview ?

SaveAs, report without preview ?

Postby Matheusfarias » Thu May 09, 2013 4:58 pm

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
Matheusfarias
 
Posts: 17
Joined: Mon Sep 10, 2012 1:55 pm
Location: João Pessoa/Paraiba/Brasil

Re: SaveAs, report without preview ?

Postby nageswaragunupudi » Sat May 11, 2013 10:34 pm

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.
viewtopic.php?f=6&t=26133
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SaveAs, report without preview ?

Postby James Bott » Sat May 18, 2013 4:17 pm

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  Expand view
#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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: SaveAs, report without preview ?

Postby nageswaragunupudi » Sun May 19, 2013 1:26 am

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SaveAs, report without preview ?

Postby James Bott » Sun May 19, 2013 1:46 pm

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

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: SaveAs, report without preview ?

Postby nageswaragunupudi » Sun May 19, 2013 1:59 pm

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SaveAs, report without preview ?

Postby James Bott » Sun May 19, 2013 3:15 pm

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: SaveAs, report without preview ?

Postby nageswaragunupudi » Sun May 19, 2013 11:48 pm

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SaveAs, report without preview ?

Postby James Bott » Mon May 20, 2013 12:02 am

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], jmartial and 119 guests