Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report Sculptor - New version posted
Message
De
27/11/2012 02:55:37
 
 
À
26/11/2012 03:01:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01558025
Message ID:
01558139
Vues:
195
This is reply to Matt
(Thread buttons did not appear under his message only ??)

Hi Matt :)

lw() method is used for is writing text in current line. Idea with .ln() /.lw() /.ltx() / .eject() methods was to provide some sort of backward compatibility for rewriting those old fashion DOS reports which were using ?/?? / eject as method of writing directly to printer device
without using FRX . (I wrote quiet a bit of those back in DOS days)

Idea is exactly the same. You start writing line by line and as you would have paper advance on a printer,
here these advances are done internally by RS engine. When page space is spent (at page eject point)
just as matrix printer would eject page and start writing on new one, exactly the same is done here by RS engine.
You write as you go. However, unlike with straight matrix printer, here you exactly know both current vertical position
AND reminder of page in pixels. (All kept in properties). Unlike majority of DOS printers, here you can actually revert row position :)

For instance
.ln(-2)  
will jump two lines up. And you can write into the same rows again.

However there are MUCH more powerful report writing methods, which use visual content created on form
(Container/Textboxes/Labels) to create report rows or entire sections (divisions in HTML terms ?)

So instead of using multiple .ln() .lw() report lines (and end up in lot of code to maintain) here you can simply create entire section visually using form designer and then use methods
select myRptCursor
.FlashContainer(oForm.ReportHeaderContainer)
scan 
  .FlashContainer(oForm.DetailBandContainer)
endscan
.FlashContainer(oForm.ReportSummaryContainer)
Effect will be the same as if you did
select myRptCursor

**block of code to write rpt header
scan

**block of code to write rpt detail
.lw(25,'text') 
.lw(50,nValue)
.

endscan
**block of code to write rpt summary
.lw() 
.lw()
.
But with huge reduction in code written! Meaning you get all flexibility of scripted report while in the same you
get to design it visually. I highly doubt that any other programming language / reporting tool can do this as easy
as we now have in VFP ;-)

So this is the idea. Now properties involved in this are folowing
.RSPageHeight
.RSPageWidth

.RSRowHeight &&when  using .ln() .lw() 

.PgReminder &&Reminder of page in pixels

.PgFooterAt  &&Page break point calculated at run time
.PgFooterHeight  &&Dependding on this prop

.nTop , .nLeft  &&Current writing position

.nColumnLeft  &&Default left margin / starting position
However you should not play to much with these. All you need to know is basically reminder of the page.
Current vertical position is not so important.

Here is code snippet from RS report code which illustrates using combination of scripting and visual report design that talked about earlier; It is from RS Demo form sample #15.
Quiet interesting report which have 3 detail bands with grouping needed within one inner band only. So there is outer scan on parent
table and then inner bands are done as separate scans. Report is titled 'Building Costs Breakdown Report', see if this rings any bells ;)
** code snippet

select parenttable
scan
.
.
select timerecords
        .FlashContainer(thisform.LabourHeader)
        scan while Timerecords.ifkey  =   parenttable.ipkey  &&Outer loop
            
            if .pgRemainder < 200
               .Eject()
            endif
        
            cGrp=str(timerecords.ifkey,1,0) +  Timerecords.mach_num
            nMachTot=0.00
            .FlashContainer(thisform.MachineGroupHeader)   &&Group Header
            scan while str(timerecords.ifkey,1,0) + Timerecords.mach_num == cGrp      &&Grouping
                nLineTot   = Timerecords.mach_rate * Timerecords.hrs_worked           &&Calculate Totals
                nMachTot = nMachTot + nLineTot
                nLabTot = nLabTot + nLineTot
                .FlashContainer(thisform.MachineDetail)
            endscan
            skip -1
            .FlashContainer(thisform.MachineGroupFooter)    &&GroupFooter
        endscan
        .FlashContainer(thisform.LabourFooter)

.
.
.
endscan

*See demo sample #15 for full report code  / content.
Now if HTML is what you are after, you can send this report to HTML via XFRX. Also to all other file formats supported by XFRX.
(If you own their license that is)

So to turn this report of yours into a web page (provided you own XFRX) you would simply use parameter 306 at the end of report session in Output method call ;
cHTMLFile = oRS.Output(306,.f.)  &&produce silently & returns path/name of result file 

**Then you take it and copy it to web folder of yours for publishing
cWebFile= '\\mywebfolder\mypage.html'
copy file (cHTMLFile) to (cWebFile)   &&or ftp or whatever

&& 301 PDF
&& 302 Word doc
&& 303 FDOC
&& 304 RTF
etc
* See RS docs for all XFRX output  parameters / file export type options
Enjoy using Report Sculptor :)
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform