Print Page | Close Window

Retrieve Parameter From TXT File

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18029
Printed Date: 02 May 2024 at 2:39pm


Topic: Retrieve Parameter From TXT File
Posted By: cryponyt
Subject: Retrieve Parameter From TXT File
Date 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.



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window