Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to identify private data session in report (good thr
Message
 
 
To
16/05/2001 12:54:23
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00507942
Message ID:
00507965
Views:
17
This message has been marked as the solution to the initial question of the thread.
You are basically SOL. There is no DataSessionID property for the report or the report's DE. The data session will appear in the Data window and show its number, but you really have no way of getting the ID. You could have the report open some dummy table, then you can loop through possible data session IDs looking for that table being open.
lnOldDSID = set('datasession')
lnOldError = on('error')
on error llBadDS = .t.
llBadDS = .f.
llFound = .f.
for lnI = 1 to 100
    set datasession to lnI
    if used('SomeTable')
       llFound = .t.
       exit
    endif
    if llBadDS
       exit
    endif
endfor
set datasession to (lnOldDSID)
on error &lcOldError
if llFound
   lnRptDSID = lnI
else
   lnRptDSID = .null.
endif
return lnRptDSID
>I have a VFP report using a private datasession that I execute as follows:
>
>public oFilters
>
>oFilters=NEWOBJECT('reportsfilter','appfilters')
>oFilters.rpt_closure_key()
>
>REPORT FORM CURDIR()+'report\&gcReportName'
>
>
>.rpt_closure_key() is the method that creates the cursor "proposal" used by the report.
>
>
>My question is, how do I tell the report the name of the cursor to use. I can't add it as a table in the data environment. In the report datasession init I tried adding:
>
> set datasession to 1
> select proprosal
>
>That works if nothing else is open, however, if I have a form open first then the report doesn't use datasession 1.
>
>Keith
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform