PRint Report from VB form

ShipDtl.PartNum is a Character field so it needs to be in quotes.

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Larry Barriere
Sent: Thursday, March 16, 2006 1:56 PM
To: Vantage Group
Subject: [Vantage] PRint Report from VB form


I am trying to print a report from the report builder using a button in a VB form.
This is the P file that I am trying to use.
I am getting a few errors Is there anyone who would have any suggestion on how I could do this.
Thank you
/*------------------------------------------------------------------------

File: v:\mfgsys61\VBP\PrintCofC.p

Description: Print BOM Report - Print the BOM from BOM.PRL
using butoon in VB form (ShipDtl)

Input Parameters: <none>
Output Parameters: <none>

Author: Larry Barriere

Created: 03/16/06 for Symmetry Medical (PolyVac)

Revision History:
-----------------
03/16/06, First Draft

----------------------------------------------------------------------------------- */



/* PrintCofC.p */
/* To Print The BOM */
/* using a VB Form button control. */


{vbp/vb.i}
DEF var report-library AS CHARACTER init "".
DEF VAR RB-REPORT-NAME AS CHARACTER INITIAL "".
DEF VAR RB-DB-CONNECTION AS CHARACTER INITIAL "".
DEF VAR RB-INCLUDE-RECORDS AS CHARACTER INITIAL "O".
DEF VAR RB-FILTER AS CHARACTER INITIAL "".
DEF VAR RB-MEMO-FILE AS CHARACTER INITIAL "".
DEF VAR RB-PRINT-DESTINATION AS CHARACTER INITIAL "?".
DEF VAR RB-PRINTER-NAME AS CHARACTER INITIAL "?".
DEF VAR RB-PRINTER-PORT AS CHARACTER INITIAL "".
DEF VAR RB-OUTPUT-FILE AS CHARACTER INITIAL "".
DEF VAR RB-NUMBER-COPIES AS INTEGER INITIAL 1.
DEF VAR RB-BEGIN-PAGE AS INTEGER INITIAL 0.
DEF VAR RB-END-PAGE AS INTEGER INITIAL 0.
DEF VAR RB-TEST-PATTERN AS LOGICAL INITIAL no.
DEF VAR RB-WINDOW-TITLE AS CHARACTER INITIAL "".
DEF VAR RB-DISPLAY-ERRORS AS LOGICAL INITIAL yes.
DEF VAR RB-DISPLAY-STATUS AS LOGICAL INITIAL yes.
DEF VAR RB-NO-WAIT AS LOGICAL INITIAL no.
DEF VAR RB-OTHER-PARAMETERS AS CHARACTER INITIAL "".
DEF VAR StringValue AS CHARACTER.
DEF VAR RBPartNum as INTEGER.
find ShipDtl where (rowid(ShipDtl) = GetCurrentRowID()) no-lock.
Find ShipHead where (ShipHead.OrderNum = ShipDtl.OrderNum) no-lock no-error.

RBPartNum = ShipDtl.PartNum.
StringValue = "ShipDtl.PartNum =" + String(RBPartNum).

RB-Report-name = "BOM".
report-library = "v:\mfgsys61\VBP\BOM.prl".
RB-Print-destination = "?".
RB-filter = StringValue.

RUN aderb/_printrb.p (report-library,
RB-REPORT-NAME,
RB-DB-CONNECTION,
RB-INCLUDE-RECORDS,
RB-FILTER,
RB-MEMO-FILE,
RB-PRINT-DESTINATION,
RB-PRINTER-NAME,
RB-PRINTER-PORT,
RB-OUTPUT-FILE,
RB-NUMBER-COPIES,
RB-BEGIN-PAGE,
RB-END-PAGE,
RB-TEST-PATTERN,
RB-WINDOW-TITLE,
RB-DISPLAY-ERRORS,
RB-DISPLAY-STATUS,
RB-NO-WAIT,
RB-OTHER-PARAMETERS).
RETURN.

/* end of program */

Larry Barriere
barriere@...


---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.

[Non-text portions of this message have been removed]



Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/links
Yahoo! Groups Links
I am trying to print a report from the report builder using a button in a VB form.
This is the P file that I am trying to use.
I am getting a few errors Is there anyone who would have any suggestion on how I could do this.
Thank you
/*------------------------------------------------------------------------

File: v:\mfgsys61\VBP\PrintCofC.p

Description: Print BOM Report - Print the BOM from BOM.PRL
using butoon in VB form (ShipDtl)

Input Parameters: <none>
Output Parameters: <none>

Author: Larry Barriere

Created: 03/16/06 for Symmetry Medical (PolyVac)

Revision History:
-----------------
03/16/06, First Draft

----------------------------------------------------------------------------------- */



/* PrintCofC.p */
/* To Print The BOM */
/* using a VB Form button control. */


{vbp/vb.i}
DEF var report-library AS CHARACTER init "".
DEF VAR RB-REPORT-NAME AS CHARACTER INITIAL "".
DEF VAR RB-DB-CONNECTION AS CHARACTER INITIAL "".
DEF VAR RB-INCLUDE-RECORDS AS CHARACTER INITIAL "O".
DEF VAR RB-FILTER AS CHARACTER INITIAL "".
DEF VAR RB-MEMO-FILE AS CHARACTER INITIAL "".
DEF VAR RB-PRINT-DESTINATION AS CHARACTER INITIAL "?".
DEF VAR RB-PRINTER-NAME AS CHARACTER INITIAL "?".
DEF VAR RB-PRINTER-PORT AS CHARACTER INITIAL "".
DEF VAR RB-OUTPUT-FILE AS CHARACTER INITIAL "".
DEF VAR RB-NUMBER-COPIES AS INTEGER INITIAL 1.
DEF VAR RB-BEGIN-PAGE AS INTEGER INITIAL 0.
DEF VAR RB-END-PAGE AS INTEGER INITIAL 0.
DEF VAR RB-TEST-PATTERN AS LOGICAL INITIAL no.
DEF VAR RB-WINDOW-TITLE AS CHARACTER INITIAL "".
DEF VAR RB-DISPLAY-ERRORS AS LOGICAL INITIAL yes.
DEF VAR RB-DISPLAY-STATUS AS LOGICAL INITIAL yes.
DEF VAR RB-NO-WAIT AS LOGICAL INITIAL no.
DEF VAR RB-OTHER-PARAMETERS AS CHARACTER INITIAL "".
DEF VAR StringValue AS CHARACTER.
DEF VAR RBPartNum as INTEGER.
find ShipDtl where (rowid(ShipDtl) = GetCurrentRowID()) no-lock.
Find ShipHead where (ShipHead.OrderNum = ShipDtl.OrderNum) no-lock no-error.

RBPartNum = ShipDtl.PartNum.
StringValue = "ShipDtl.PartNum =" + String(RBPartNum).

RB-Report-name = "BOM".
report-library = "v:\mfgsys61\VBP\BOM.prl".
RB-Print-destination = "?".
RB-filter = StringValue.

RUN aderb/_printrb.p (report-library,
RB-REPORT-NAME,
RB-DB-CONNECTION,
RB-INCLUDE-RECORDS,
RB-FILTER,
RB-MEMO-FILE,
RB-PRINT-DESTINATION,
RB-PRINTER-NAME,
RB-PRINTER-PORT,
RB-OUTPUT-FILE,
RB-NUMBER-COPIES,
RB-BEGIN-PAGE,
RB-END-PAGE,
RB-TEST-PATTERN,
RB-WINDOW-TITLE,
RB-DISPLAY-ERRORS,
RB-DISPLAY-STATUS,
RB-NO-WAIT,
RB-OTHER-PARAMETERS).
RETURN.

/* end of program */

Larry Barriere
barriere@...


---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.

[Non-text portions of this message have been removed]