Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Set Paradox Table Locations with RDC

Posted on 2004-04-02
Medium Priority
Last Modified: 2008-02-01

I'm using Delphi with the 8.5 RCD component to create a standand alone CR application. I want to offer a function which allows users to quickly set the database location of all the tables in a report to where I know the data will be. The code is easy enough to do (iterating through all the tables and then subreport tables) buts its outrageously slow! On a report with about 25 tables  it takes 2 minutes! i.e. 4 seconds for each iteration in this code snippet:

    for i := 1 to rpt.database.tables.count do
     s  :=FindPath('htdb') + rpt.database.tables.item[i].name + '.db';
     rpt.database.tables.item[i].location := s;

If you do it manually in the Designer from the in built popup menus then once you commit the changes it does seem to take a few seconds, so I was wondering whether this overhead / function call is happening for EACH table I set the location for? Is there a way around this? I tried the alternative, 'SetTableLocation' method (rpt.database.tables.item[i].settablelocation (s,'','')) but that always returns an error of  'Invalid Pointer' :-(

Any ideas?

Question by:tomsie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 101

Expert Comment

ID: 10740718
What is the horsepower of the machines?  Can you try the code on some faster machines and see if it runs any faster or if it is a connection through Crystal issue.  25 Tables seems like an awful lot of tables to connect to.

Are you sure it is in that code and not just the time it takes to generate the report?

One thought.  Does this call always return the same value - FindPath('htdb') -?  If so put it outside the loop as

strPath = FindPath('htdb')

Then you can use strPath instead of the call.


Author Comment

ID: 10743266
Hmm..I replied to this but my post seems to have been lost. To summarise: its not FindPath() that has the overhead though I agree its silly to call it in a loop); its definitely the RDC. I suspect its calling the same routine that it uses in its own environment for setting database locations over and over again. I don't think 25 tables is an awful lot and we've been using this report for years and setting its location when printing via our main app using CRPE32 API calls. Its takes a split second there.

Perhaps this is a design oversight by Seagate. My PC is 633 Mhz and about 320Mb RAM. Not great but not awful either.
LVL 101

Expert Comment

ID: 10745973
I suspect the RDC wil be slower because it will translate your calls into API calls.  The RDC is designed to make our lives easier not necessarily run reports faster.

Are these subreports?  

Has the database grown appreciably?

Is the network overloaded?


Author Comment

ID: 10755882
Running (previewing) the report is not the problem; that is fast regardless of the (local) database size. The problem is just setting the table locations before the report is previewed. I think this is just a design flaw in the RDC since is you set the database locations manually (right click  , Set Database Location) then then native interface for doing it is very fast. Doing it in code the performance gets exponentially worse for "each" table location assignment as the number of tables in a report increases, i.e. if only 2 tables then a few millisecond for "each" assignment, if 17 then 5 seconds for each. No doubt the RDC as iterating through all the tables performing some checks each time it sets a location. The really curious thing though is that that my report does have 2 subreports (each with 4 tables) and these zip through in no time at all, i.e. faster than a standalone report with 4 tables.

I think I will just have to live with it a put a progress bar indicator in the project somewhere. Thanks for the help.

Accepted Solution

modulo earned 0 total points
ID: 11871800
PAQed, with points refunded (250)

Community Support Moderator

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question