Close DBF Table opened by Crystal Reports XI via ADS 8.1

Close DBF Table opened by Crystal Reports XI via ADS 8.1

Postby mario.paiva » Mon May 07, 2007 11:09 am

Hi all,

I am evaluating Crystal Reports XI working with FWH and ADS 8.1

Things are working fine but something is missing...

This is how it works:

I execute my app from client machine that creates a .dbf table with all the
information that i need to put on the report previously created in Crystal
Reports XI. Then a connection to the ADS 8.1 is established via Crystal
Reports Driver 8.1. using a data dictionary.

This data dictionary created with Architect 8.1 have all the tables (.dbf´s)
needed by my app. In the next step ActiveXReportViewer opens and shows the
report with the information contained in the table.

With Architect opened I verified that a connection to ADS is established
with the correspondent dictionary (.add) and table (.dbf). Everything works
fine until this moment.

But when I close the ActiveXReportViewer, this connection and the assotiated
dbf file remains open by ADS. The only way I have managed to close this
connection was using Architect and manually closing the connection or wating
about 4 minutes later to ADS automatically close it by itself.

I need to delete this temporary dbf to create another with the same name and
refreshed information from database.

The big question is this ... How can we force to close the data dictionary
connection and the correspondent tables from inside our app code after the
information needed by crystal reports is not necessary anymore.

The ideal cenario would be closing the connection and tables when the app
user close the Cristal Reports Viewer. That way next user that runs the app
would have that dbf with refreshed information on it.

All the help in this issue is welcome and would be really apriciated.

This is my code app:

#include "Fivewin.ch"


FUNCTION MAIN()

LOCAL oCrystal := CREATEOBJECT( "CrystalRuntime.Application" )
LOCAL oReport := oCrystal:OpenReport( "mapa001.rpt" )

LOCAL oWnd, oCRViewer

DEFINE WINDOW oWnd

oCRViewer = TActiveX():New( oWnd, "CrystalReports115.ActiveXReportViewer.1" )

oCRViewer:SetProp( "ReportSource", oReport )

oCRViewer:SetProp("DisplayGroupTree",.F.)

oCRViewer:SetProp("WindowTitle","Listagem do Mestre de Bens")

*/oCRViewer:SetProp("DisplayToolbar",.T.)

oReport:HasSavedData()
oReport:DiscardSavedData()
oCRViewer:Do( "ViewReport" )

oWnd:oClient = oCRViewer


ACTIVATE WINDOW oWnd;
MAXIMIZED

RETURN NIL

Thanks and best regards,

Mário Paiva
User avatar
mario.paiva
 
Posts: 6
Joined: Thu Apr 19, 2007 8:27 am
Location: Lisboa

Postby MOISES » Tue Sep 11, 2007 11:50 am

Hi,

I compile this sample but CREATEOBJECT is missing. Where I can find it?. Thank you!!!.

Regards,
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Postby MOISES » Tue Sep 11, 2007 3:29 pm

I solved it, I have to link a lib
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests