Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change DataBase folder at runtime
Message
 
À
29/08/2001 13:14:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00550433
Message ID:
00551732
Vues:
18
>>How can i change the folder where my report can take data at runtime.
>>I have used the ocx control and the "CrystalRuntime.Application" object but i don't find the method or property to set this value.
>
>Hope you're not using ODBC and this helps :
>
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
>
Cetin

In my app I use not free tables but database container so i have to use ODBC in my report. I use CR 7.0; i don't know if in CR 8.x VFP Database can be open directly without use ODBC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform