Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp6 y crystal reports
Message
De
16/01/2001 09:23:48
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00464157
Message ID:
00464165
Vues:
22
>i have a report made in crystal reports
>
>i have a huge reports, that use two table of my database, from my app in vfox, so, i have to preview and print this report from my app
>
>so how do i make that my app and the crystal reports work together for this task
>
>note: the report i didn't make it in vfp because it was to large and the vfp got to the limit, so i couldn't continue
Select * from myTable where Something into cursor myCursor
_CRReport("myCursor","c:\myCR_RPT_Files\", "myTest.RPT", "myTable")

Function _CRReport
  Lparameters tcCursorName, tcPath, tcRPTName, tcTableName

  lcAlias = alias()
  Select (tcCursorName)
  lcTemp = sys(2015)
  Copy to (tcPath+lcTemp) type fox2x
  oCrystal=CreateObject("Crystal.CRPE.Application")
  #Define WS_MAXIMIZE  29949952
  Declare integer GetForegroundWindow in WIN32API
  Declare short IsWindow in WIN32API integer


  oRpt = oCrystal.OpenReport(tcRPTName)
  With oRpt
    With .Database.Tables(tcTableName)
      .Location = tcPath+lcTemp+".dbf"
    Endwith
    With .PrintWindowOptions
      .CanDrillDown = .t.
      .HasCancelButton = .t.
      .HasCloseButton = .t.
      .HasExportButton = .t.
      .HasGroupTree = .t.
      .HasNavigationControls = .t.
      .HasPrintButton = .t.
      .HasPrintSetupButton =.t.
      .HasProgressControls  =.t.
      .HasRefreshButton  =.f.
      .HasSearchButton  =.t.
      .HasZoomControl  =.t.
    Endwith
    .preview ("Report Preview ...",,,,,WS_MAXIMIZE,0)
  Endwith
  lnHwndActiveX = GetForegroundWindow()	&& Save window handle
  Do while IsWindow(lnHwndActiveX) # 0  && Wait while Activex Alive
  Enddo
  Clear dlls

  Erase (tcPath+lcTemp+".*")
  If !empty(lcAlias) and used(lcAlias)
    Select (lcAlias)
  Endif
Hope helps
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform