Precisely Speaking
May 18, 2012, 03:13:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Report Writer Question (Continuation)  (Read 3170 times)
adewitt
Professional
***
Posts: 42


« on: April 14, 2009, 12:26:25 PM »

I have this report.  The request is that I don't print a blank page (headings but no detail) if there is no data to report.  This has a Process At Start that I tried to head off the calling of the report but to no avail.  So I'm using Conditional fields.

In the Break condition it says: IF(@KEY<1,1>='',3,0).  Now it's not printing the Break Total at the end of a one page report.  So two questions: 1) How can I get this to print the Break Total where there is data, but not print it if there isn't?  2)Why is Report Writer such a pain when trying to suppress printing?

                    Report Definitions  :  BATCHRPT BTCR9002           C000 R001
   T1234567890123456789012345678901234567890123456789012345678901234567890123456
    --------10--------20--------30--------40--------50--------60--------70------
 1|HC                                                                           
 2|HREPORT NAME: BTCR9002                                    STYLMARK, INC     
 3|HFILE USED:   BATCHRPT                                                       
 4|HPROCESS ID:  BTC9002                              C U T L I S T   R E P O R
 5|HUSER ID:     XXXXXXXXXXXX                                                   
 6|                                                                             
 7|C     Work Orders:  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 8|C                                                                           
 9|C Start Date: 04/14/09                                                       
10|C   End Date: 04/14/09     1st Job: XXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
11|C  Batch Num: XXXXXXXXXX                                                     
12|C                                                                           
13|C WO Nbr   Extrusion   Fab Nbr       Mtr    Cut Length  Qty   A-Dim    B-Dim
14|C -------- ----------- ------------- --- ------------- ----- -------- -------
15|D XXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXX XXX 9999999999999 99999 XXXXXXXX XXXXXXX
16|D                                                                           
17|BC                                                                           
18|B          XXXXXXXXXXX                                 99999                 
19|B                                                                           
                                                                               
F2-Save F4-Del F5-Field F6-Params F7-Trial F8-Move F9-Effects F10-Action       
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #1 on: April 14, 2009, 12:28:36 PM »

What's your selection criteria look like?
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
adewitt
Professional
***
Posts: 42


« Reply #2 on: April 14, 2009, 03:18:22 PM »

                    Report Definitions  :  BATCHRPT BTCR9002           C000 R001
   T1234567890123456789012345678901234567890123456789012345678901234567890123456
    --------10--------20--------30--------40--------50--------60--------70------
 1|HC                                                                           
 2|HREPORT NAME: BTCR9002                                    STYLMARK, INC     
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄReport ParametersÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿       
³ Multiple Records/page  Y   (N/Y/H)                                    ³ P O R
³ Description Source     N   (N/S/A/C)                                  ³       
³ Output Device          P   (S/P/X/D/F/H/A)    Allow HTML  N   (Y/N)   ³       
³ Totals Only            N   (Y/N/A)            Align Forms N   (Y/N)   ³XXXXXXX
³ Two Pass Report        N   (Y/N)              Send to PDF N   (Y/N)   ³       
³ Screen Window Co-ords                                                 ³       
³ Sort Fields            BTC9002_EXTR BTC9002_LEN(D                     ³XXXXXX
³ Break Fields           BTC9002_EXTR                                   ³       
³ Selection Criteria     BTC9002_SEL = "BTC9002"______________________  ³       
³ Process At Start                                                      ³ B-Dim
³ Process After Read                                                    ³-------
³ Process Before Break                                                  ³XXXXXXX
³ Process After Break                                                   ³       
³ Process At End                                                        ³       
³ Pages to Store          10                                            ³       
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ       
                                                                               
F2-Accept F5-Gen Deft F6-Addit F7-Convert Query F8-Convert Screen F9-Colors     
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #3 on: April 15, 2009, 07:25:11 AM »

The first problem, as I see it, is that the report has a break section and therefore must have some kind of grand total section.  This is a trigger to the ReportWriter that tells it to print "something" even when there's no data to be printed.

When the report writer sees the end of the selected records it sets @KEY = @AM.  You can then check this PLUS the number of records counted (@RV.RECORD.CNT) and if this is zero then you know nothing was selected.

This expression: IF(@KEY = @AM AND @RV.RECORD.CNT = 0,n,0)

...will need to be placed not only on the heading section, but also on the break and grand total sections to be sure those are also skipped.  It will still likely send a blank page when printed, however.

Alternatively, you might try selecting your records outside of the /RD and then check to see if you have anything before calling the /PD.R process.  That's what many vendors do to mitigate this issue.  So for an example you could create a calling process that uses a /PD.S to select the records you want to process and if that comes back with nothing, don't call the /PD.R.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
adewitt
Professional
***
Posts: 42


« Reply #4 on: April 16, 2009, 12:01:04 PM »

We needed a break by part number (EXTRusion number) to display a total number of sticks.  We didn't need a grand total (even though SB gives you one whether you want it or not).

The Condition statement worked on the Break Total.  So I'm good for now.  I just wish it wasn't so blasted difficult to suppress printing.

Thanks.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #5 on: April 16, 2009, 12:42:28 PM »

While not all that intuitive, you can suppress the grand total by putting a blank "G" line after the break section.  If you don't do this, SB+ assumes you must've forgotten and repeats the break section as if it was the grand total.  Gotta love when the tool thinks it's smarter than the developer, eh?  Cheesy
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!