Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Retrieve Parameter From TXT File Post Reply Post New Topic
Author Message
cryponyt
Newbie
Newbie
Avatar

Joined: 19 Nov 2012
Location: Canada
Online Status: Offline
Posts: 1
Quote cryponyt Replybullet Topic: Retrieve Parameter From TXT File
    Posted: 19 Nov 2012 at 9:59am
I have a user that would like to run a report locally, and would like to enter a cut over hour for changing from lunch to dinner, but does not want this to be a parameter that is asked when the user runs a report. Instead, the user wants to use an external file (i.e. text file) to hold the value and have the report read this value, and set formulas accordingly. I had considered making the value a part of the report name, and then just using the value in the name for the variable ("i.e. "Report_13.rpt" to be a 1pm cut off). Of course, I would have a default if the name was changed so that it did not fit the required format. My question is, "Is there an easy way to read the data from text file?" I have considered using an XML file, bit not sure if Crystal can be set to read the XML from the local directory of the rpt.

Thank you.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 19 Nov 2012 at 10:38am
You would have to set the file up as a data source for the report.  The problem with this comes if you're using the data from the text file to filter the data in the report.  If this is the case, the report will NOT push the selection criteria down to the database.  Instead, it will load all of the data into memory and filter the data in memory instead of pushing the selection criteria down to the database to filter the data there and only return the records that the report wants.  If the data that the report would pull without any selection criteria contains a lot of rows, this means that the report would be significantly slower than if you just use a parameter - first, because there's a lot more data that will have to be pulled in from the database and second, because Crystal is not as efficient at filtering data as a database is.  This could also take up a significant amount of disk space as Crystal does a lot of swapping data to and from a temp file while it's processing it under these circumstances.  I would test it both ways to determine the impact before just letting the user have what he wants - especially if there's not a really good reason for it other than a user want.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.