Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer definition in Expr, Tag and Tag2
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01265364
Message ID:
01265540
Views:
10
I thank each of you.
Rick
-------------------------------
>>I apologize for what I know has been answered before, but my firewall won't allow me to perform a search (it won't allow certain pieces of information to be sent out, which UT uses as part of it's search validation)
>>
>>In the .FRX files there are 3 fields that contain information in record 1 about what printer the report was designed in/for...
>>EXPR, TAG, TAG2
>>
>>What do I need to strip out to make the report not have printer specific information?
>>
>>We set up our network printers such that each tray of a printer is treated as a different printer. So if this printer (hardware) has 3 trays, then it is represented was 3 different printers. One only knows about tray 1, another only knows about tray 2, and the 3rd only knows about tray 3.
>>
>>My user has his default printer set to tray 3 of printer "X"
>>
>>I have a report which when being previewed, if the print icon is clicked, the report tries to print to the right printer (hardware), but to tray 1... however, if the user clicks MY print button, which does a
>>REPORT FORM _____ TO PRINTER NOCONSOLE PROMPT
>>The Windows Printer dialog box defaults to the correct logical printer and tray... and if the user prints to that printer and tray, then it prints as it's supposed to print.
>>
>>The printer information in the FRX record one is for a different logical "printer", of the same brand and model (HP 4000tn)... just because that's the printer I had as my default when I created the report.
>>
>>I suspect that's why the icon is printing to the wrong tray... because it's getting confused...
>>
>>TIA,
>>Rick Liebespach
>
>Not sure if this will fix the icon but here is the .prg we run on our reports to make sure they will run on any customer's printer. The include file should not be needed.
>
>NOTE: This must be run in the folder with your rpt files. If you only want to do one file then open the .frx and then just run the 2nd procedure (PROCEDURE frxcleanup)
>
>*
>* check for reports where tag and tag2 are not empty in rec 1
>*
>*  #INCLUDE jhenn.h
>*
>create table rptfix (name c(10), rptfile c(15) )
>*
>select 0
>*
>set defa to g:\crisma\rpts
>mcnt = adir(arpts, '*.frx')
>for i = 1 to mcnt
>  wait window nowait arpts(i,1)
>  use (arpts(i,1))
>  *
>  if (not empty(tag)) or (not empty(tag2))
>    m.name = juststem(arpts(i,1))
>    m.rptfile = arpts(i,1)
>    ? m.rptfile
>    insert into rptfix from memvar
>    *
>    * Fix it
>    =frxcleanup()
>  endif
>endfor
>*
>select rptfix
>brow
>
>
>
>*
>* -----------------------------------------------------------------------
>*
>PROCEDURE frxcleanup
>*
>locate
>
>replace tag with '', tag2 with ''
>*
>mfirst = .t.
>mfound = .f.
>mexpr = ''
>_mline = 0
>for i = 1 to memlines(expr)
>  mln = mline(expr, 1, _mline)
>  *
>  * remove the printer specfic stuff
>  if upper(alltrim(mln)) = 'DEVICE' .or. upper(alltrim(mln)) = 'OUTPUT'
>    loop
>  endif
>  *
>  * add the paper tray setting for auto select
>  if mln = 'DEFAULTSOURCE'
>    mln = 'DEFAULTSOURCE=265'
>    mfound = .t.
>  endif
>  *
>  if .not. empty(mln)
>    mexpr = mexpr + iif(mfirst, mln, iLf + mln)
>    mfirst = .f.
>  endif
>endfor
>*
>if .not. mfound
>  mexpr = mexpr + 'DEFAULTSOURCE=265'
>endif
>*
>replace expr with mexpr
>*
>* now compile the report
>use
>compile report (arpts(i,1))
Previous
Reply
Map
View

Click here to load this message in the networking platform