Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters from file?

Status
Not open for further replies.

waldopepper

Programmer
Nov 21, 2003
124
GB
Here's a bit of a shot in the dark, is there any way with Crystal Enterprise file events that you can read in text from the file to use as parameters with a published report?
 
What sort of file, what version of crystal?

Please remember that descriptions can be helpful, but if you neglect topost basic technical information you're going to slow the process while we attempt to perform discovery of your environment.


I don't think that you can do this using events, but CR XI does allow for dynamic parameters.

-k
 
Oops sorry totally forgot to post that!

I'm using Crystal Reports/Enterprise v10.

I'm referring to CE's ability to run reports triggered by a file appearing on the server in question (events). I've never used this feature but I've just had a look at the settings available for this and it basically looks like it's very limited.

I just wondered if a report can be driven by the arrival of a file & the reports expected parameters contained within (4 seperate numeric parameters). These could be saved in this 'control' file and drive the parameters in the report.

e.g.

Parameter1=40
Parameter2=299

etc

?

ta
 
CE 10 doesn't support dynamic parameters, however you might use this text file as a table and JOIN the parameter values to your database fields.

Within code in CE I suppose any of this is possible, but the above offers a means to do so more simply.

A shame that your process can't just write values to a table in the database and you an just have a View set up to return the data, seems much more logical.

-k
 
OK ta - that's a good idea. I could have a process update values in a table just as before the file is output to trigger the report & use these values in the report as parameters (from views).

thanks
w
 
You won't need the values as parameters in the report.

Add the values to a table, join by the field to the appropriate table containing the data using a left outer and you have only those rows. If you reuse a table then you'll need some other identifier to denote which rows are to be joined, however if you drop the table, thn add the rows you'll have an efficient View that always returns the proper data.

-k
 
Ooops, I meant truncates the table, not drop it, though you could drop and recreate it as well.

-k
 
Been there, done that, know the problem. The approach we used was to write a simple dll that provided us a UFL capable of reading an INI file entry.

We used VB version 6 to build the active X object. There is a knowledge base article on the Business Objects web page ( that gives you a cook book to getting this done, (SCR_User_Defined_Functions.pdf). All you need to know is how to write to the Windows API and use the GetPriviateProfileString Win32 API function. Once you have the DLL up and running you may commit selection criteria to an INI file such as:

[PRODUCT LINES]
PLINE1=PRINTERS
PLINE2=PLOTTERS
PLINE3=DRIVES

The selection formula

Would go something like this: where the function inside the DLL is GetINI
stringVar sFilename = “c:\windows\myini.ini”:

{@ProductLine}= EvnCrwEnviornGetINI (“PRODUCT LINES”,”PLINE1”,sFilename);

Or you could loop through the [PRODUCT LINES] entry and push all three entries into an array and select using the equals criteria.

Down sides:

This only works in the Windows World. It will not work with another operating system.

If you are running reports from workstations the DLL must be at each workstation.

I cannot be implemented using .NET
 
bobbyga: Why wouldn't you just update a table and join it?

Less code, nor DLLs and it would be faster.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top