Re: user-adjustable reports
From: christophe (irs.znospamforme_at_skynet.be)
Date: 02/11/05
- Next message: christophe: "Re: execute pc code from a command button"
- Previous message: Newbie: "Re: return value from sproc with spt"
- In reply to: Paul Pedersen: "Re: user-adjustable reports"
- Next in thread: Paul Pedersen: "Re: user-adjustable reports"
- Reply: Paul Pedersen: "Re: user-adjustable reports"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 11 Feb 2005 09:30:52 +0100
hm rumblings,
about the price,
you only need a Set Path To localreportspath, serverreportspath
this piece of code will cut your time of work into half and will please your
user
and then hopefully your wallet.
(btw : I'm an "inhouse" developer, so I'm already paid for this piece of
code ... ;-)
*rename all your reports/labels so it starts with "i_"
*these need to be included in your project.
*and later on execution will be copied to the server/localdrive without "i_"
*when calling the report in your exe, call the name without "i_".
*create a projecthook and in the BeforeBuild add this :
*it will add all reports/labels included in your project into a table and
the table
*will be added into your project / exe.
If m.nBuildAction = 3
* CREATE TABLE "c:\yourpath\projectincl.dbf" FREE (bestand C(50),soort
C(1))
_vfp.ActiveProject.files("c:\yourpath\projectincl.dbf").Remove
USE c:\yourpath\projectincl.dbf excl IN 0
zap
For Each oFile In _vfp.ActiveProject.Files
type_ = ofile.type
fname_ = JUSTFNAME(ofile.name)
DO case
CASE Type_ = "R"
WAIT WINDOW "report : "+ofile.name nowait
INSERT INTO "projectincl" (bestand,soort) VALUES (fname_,type_)
case Type_ = "B"
WAIT WINDOW "label : "+ofile.name nowait
INSERT INTO "projectincl" (bestand,soort) VALUES (fname_,type_)
Endcase
NEXT
USE IN SELECT("projectincl")
ofile = _vfp.ActiveProject.Files.Add('c:\yourpath\projectincl.dbf')
ofile.exclude = .f.
Endif
*in your app.
*copy reports/labels to server drive if they don't exist
do rapportupdate_
Procedure rapportupdate_
Local rapporttot,labeltot
*rapporten
Use "projectincl" Alias "incl" IN 0
Scan For soort $ "BR"
*copy frx/lbx
exerapport_=Alltrim(Incl.bestand)
localbestand_=yourpath+Substr(exerapport_,3) &&del i_
If .Not. File(localbestand_)
=Strtofile(Filetostr(exerapport_),localbestand_)
Endif
*copy frt/lbt
exerapport1_=Left(exerapport_,Len(exerapport_)-1)+"t" &&replace x met t
.frx/.lbx => .frt/.lbt
localbestand_=f_rpt+Substr(exerapport1_,3) &&del i_
If .Not. File(localbestand_)
=Strtofile(Filetostr(exerapport1_),localbestand_)
Endif
Endscan
Use In Select("incl")
Return
call me if it doesn't work
because I've stripped some code to fit your needs
regards,
christophe
"Paul Pedersen" <no-reply@swen.com> schreef in bericht
news:Oh6sWA5DFHA.1932@TK2MSFTNGP10.phx.gbl...
> I've thought of that one too. In this case, the users all print to the
same
> printer, but if that ever changes, I could use your idea of keeping a
local
> copy.
>
> I'm starting to hear rumblings now about cost, so I don't want to spend
time
> adding features that are not specifically requested.
>
>
>
> "christophe" <irs.znospamforme@skynet.be> wrote in message
> news:uVh5hS1DFHA.3368@TK2MSFTNGP10.phx.gbl...
> > Hi paul,
> >
> > Just my experience :
> > I also have users which in the beginning I avoided to let them
> > alter the reports themselves.
> > Then I changed a bit my app so when they mess up a report,
> > the app deletes it (or they do it themselves) and a new one
> > is copied from the app at restart.
> >
> > I did even more, when the user makes a copy of the report and places it
> > in a local drive then the app uses that one, instead of the one on the
> > server.
> > So each user has now his own report that can be modified to fit his
> > printer
> > or
> > logo or whatever he want to fit his needs.
> > now they (and me ofcourse) can't hardly live without this "feature".
> >
> >
> > regards
> > christophe
> >
> > "Paul Pedersen" <no-reply@swen.com> schreef in bericht
> > news:uOweMbiDFHA.3728@TK2MSFTNGP14.phx.gbl...
> >> Thanks for the suggestion. That should work well enough for vertical,
but
> >> I'd have to use a monospaced font to get the horizontal adjustment to
> >> line
> >> up properly.
> >>
> >> Also, it would require users to modify the reports themselves, which
I'd
> >> prefer to avoid.
> >>
> >>
> >>
> >>
> >> "Allan" <Allan@discussions.microsoft.com> wrote in message
> >> news:2702FEFA-7180-4683-9079-168482845119@microsoft.com...
> >> > Hi Paul,
> >> >
> >> > I had a similar problem before and what I did is to use a 'slack'
> > textbox
> >> > at
> >> > the beginning of the detail band using a font size of 6. The
controls
> >> > containing the actual data at set to move relative to the top of the
> >> > detail
> >> > band. I use a 'page-setup' form to allow the user to adjust the top
> >> > and
> >> > fill
> >> > the 'slack' textbox with empty spaces during printing. You can also
do
> >> > this
> >> > on the margin at the left by placing 'slack' spaces before the
controls
> >> > actual data like: SPACE(lnLeftMargin) + lcActualData +
> > lcOtherActualData.
> >> >
> >> > Hope this will help,
> >> >
> >> > Allan
> >> > "Paul Pedersen" wrote:
> >> >
> >> >> I have reports with one record in a tall detail band, no header,
> > footer,
> >> >> title, nor summary. These are intended to be printed on pre-printed
> >> >> forms,
> >> >> with the text boxes filling in the blanks.
> >> >>
> >> >> As expected, there are alignment differences for different users
using
> >> >> different printers. Alignment between the individual controls does
not
> >> >> change, but margins do.
> >> >>
> >> >> I can allow the user to edit the report, but these users are not
> >> >> particularly computer savvy. I have grouped all the controls on the
> >> >> report,
> >> >> and I would like to allow the user to specify something like "move
> >> >> everything up 1/8 inch and right 1/4 inch", then have the app make
the
> >> >> adjustment.
> >> >>
> >> >> Can this be done with report listeners? Or is it best to hack the
> > report?
> >> >> Something like
> >> >>
> >> >> REPLACE hpos WITH hpos + 10 FOR objtype = 8
> >> >>
> >> >> Or, since I have grouped the controls, is there a simple way to
> >> >> reposition
> >> >> the group? How are groups represented in the frx?
> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >
> >
>
>
- Next message: christophe: "Re: execute pc code from a command button"
- Previous message: Newbie: "Re: return value from sproc with spt"
- In reply to: Paul Pedersen: "Re: user-adjustable reports"
- Next in thread: Paul Pedersen: "Re: user-adjustable reports"
- Reply: Paul Pedersen: "Re: user-adjustable reports"
- Messages sorted by: [ date ] [ thread ]