Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What has happend with preview report in VFP7?
Message
De
23/10/2001 13:35:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00565389
Message ID:
00572173
Vues:
29
>>This sounds like the problem I have... I'm using a private datasession created with the session class. Is there any solution to it?
>
>Yes, but they involve a fair amount of programming, depending on what you want to do. I'll sketch some ideas out here about what we did.
>
>We wanted to be able to let the user view multiple reports on the screen at once. It actually does work (finally). But what you need to do is define the report (report designer) as running in a private data session.
>
>This turns out to be a real pain in the ass. My biggest problem was that I used to (in FP2x) create first run an "initialization" program that would create memvars, cursors, and relations to create an "environment" where the report would run. When you use a private data session these no longer are available.
>
>So our report driver program actually works in 2 different ways. When printing to a PRINTER, it uses the default datasession -- called from a SESSION object, but it works OK. First it runs the "init" program. The variables and cursors are there, so everything is cool.
>
>But when you PREVIEW to the screen, it does the opposite. It runs the report in a private data session. It starts the report. Then the data environment calls a special program which runs the "init" program to create the cursors, etc.
>
>You should now ask me how the same report can run with private data session in one case and default data session in another. The answer is you have to learn to hack an FRX! We let our users design their own reports, by the way. But we never run the report they design. We copy it to a temporary FRX and run the copy. During that copy process, we stick in the appropriate data environment.

I implemented multiple reports in screen by modifying genrepox utility.
I add a Opentables method to report at run time. This forces report to
use private data session of the calling form and allows to use keyboard to navigate in report preview.I use report datasession name to store reports
data session number, havent found other way for it.
  IF g_MODELESS
    local calias
    calias = alias()
    sele 0
    use (pcGRXTempName+'.frx') 
    loca for objtype = 25 and platform='WINDOWS'
    if !found()
      appe blank
      endif
    repl platform with 'WINDOWS', ;
      objtype with 25, ;
      name with 'dataenvironment', ;
      expr with 'Name = "Dataenvironment"', ;
      environ with .t., ;
      tag with 'PROCEDURE OpenTables'+ CR_LF + ;
        'SET ECHO OFF'+ CR_LF + ;
        'SET TALK OFF'+ CR_LF + ;
        "IF TYPE('m.g_repodatasession')='N' AND m.g_repodatasession>1 AND " + ;
        ' this.name="Dataenvironment"'+ CR_LF + ;
        '  this.name = [S]+ltri(str(m.g_RepoDatasession))'+ CR_LF + ;
        '  ENDIF'+ CR_LF + ;
        'IF LEFT(THIS.NAME,1)="S"'+ CR_LF + ;
        '  SET DATASESSION TO (val(subs(this.name,2)))'+ CR_LF + ;
        '  local csess'+ CR_LF + ;
        '  csess = subs(this.name,2)'+ CR_LF + ;
        '  ENDIF'+ CR_LF + ;
        'ENDPROC'
use
    compile repo (m.pcGRXTempName)
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform