Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preview a report without having the title of the designe
Message
De
30/11/1998 16:21:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00161176
Message ID:
00162558
Vues:
18
>Hi, everyone!
>
>I have designed a report and want to able to both print it out and preview it on the screen. When I use "REPORT FORM myForm PREVIEW", I encounter two issues. First, the user will get an error if he clicks the menu bar I build; the message says, "Activeform is not an object". My solution is to create a dummy menu from VFP's system menu. It is not very slick but seems to be doing the job. The second and unsolved issue is that the caption of the window containing the report is now showing something like "Report Designer: myReport.frx". I used _Screen.Caption trying to replace it with something more user-friendly, but it only changed the caption of the screen of my application. I assume I could go for API calls, but it sounds like an overkill...
>
>I would appreciate it greatly if you would point to me the right directions for both of the issuses.
On the first problem, well.. I let the user play with the default report preview toolbar. With the caption, you can show the report in a custom form and assign the right caption at runtime.. I have this custom class that is used for displaying report previews, and pass a parameter for the caption:
Define Class PreviewWindow As Form
  Name = "frmPreview"
  Caption = 'Report'
  WindowState = 2
  Proc Init
    Parameters ThisTitle
    If PCount()>0
      This.Caption = ThisTitle
    Endif
    This.Show
  EndProc
EndDefine
Then, the actual call to the report preview goes something like:
Local oPrev
oPrev = CreateObject("PreviewWindow", "My Custom Caption")
REPORT FORM myrepform NOCONSOLE PREVIEW WINDOW frmPreview
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform