Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Problem Revisited
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Crystal Problem Revisited
Miscellaneous
Thread ID:
00907410
Message ID:
00907410
Views:
51
Criag,

We've discussed this a few times, but Im not sure if I have
ever completely solved it.

When creating a report, I create a snapshot of the data into a Fox2x
table called 'Temp1'.

I create a report based off an xBase data source and add into the
report the table 'Temp1'

But in runtime in my app, I might generate the data into a completely
different table, who's name is generic, sat "_KD2LD2L.dbf". I often use
the SYS(2015) function to create a unique table name for this.

Next I need to tell the report that the table 'Temp' is really '_KD2LD2L.dbf'.
So I created this short procedure:
PROCEDURE SetTableLocation(oReport as Object, cTable as String, cAlias as String) 

  LOCAL oDatabase, oTables, lFound

  WITH This

    cTable = UPPER(ALLTRIM(cTable))
    cAlias = UPPER(ALLTRIM(cAlias))

    IF EMPTY(JUSTSTEM(cTable))
      cTable  = ALLTRIM(cTable) + ".dbf"
    ENDIF


    oDataBase	= oReport.Database
    oTables 	= oDataBase.Tables

    FOR iTable = 1 TO oTables.Count

     oTable = oTables.Item(iTable)

     IF cAlias = UPPER(ALLTRIM(oTable.Location))

      lFound = TRUE
      oTable.SetTableLocation(cTable, JUSTSTEM(cTable), "")

     EXIT

   ENDIF

ENDFOR		
This basically searches through the table collection looking for the alias
'Temp1' and sets the full path and name of that table to my new table.

Sometimes this works, but fiarly often I get a 'Logon Failed' error. I'm at
a loss, and when I called Crystal and and asked them about it, the tech acted
as if he had never heard of VFP, lets alone test in it.

So, I'm really stuck on this. Could use your help.

Many Thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform