Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Report Parameter Values

Posted on 2014-04-02
9
Medium Priority
?
1,427 Views
Last Modified: 2014-04-15
I have a crystal report that I need to pass the values to its parameter programmatically, what's the best / most-optimal way to do that?
Thx
0
Comment
Question by:Roberto Madro R.
[X]
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
  • 5
  • 4
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39973257
I don't think there is really a "best" way to do that.

The best way to handle this, in my opinion, is to build the report to use a dataset and have the application open the dataset and pass the data to the report.  This is known as the push method.

If you pass the parameters to the report it is using the pull method which has many more pitfalls.

Here is an example of using the push method
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

If you need to pass the parameters
What version of Crystal?
What method are you using to open the report?
What language are you using for the application?

Perhaps the easiest method is to just call the report and let Crystal prompt using the default parameter screen

mlmcc
0
 

Author Comment

by:Roberto Madro R.
ID: 39973525
Great to hear from you mlmcc, I'm using Crystal 11.5 and I publish these reports to a crystal report server and they're accessed by users via our intranet (website-like access), as for what application I need to embed this report in, I can do asp or c#, but I need to know how to embed an existing report and supply its parameter with values when it's run or is scheduled to run.

Thanks for the link as well, (although old) a very interesting walkthrough.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39973541
Even though it is a bit old, it is still accurate on how to do it.

If you are publishing through CR Server why the need for an application?

mlmcc
0
Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

 

Author Comment

by:Roberto Madro R.
ID: 39973552
I'm exploring what CR Server offers in that regard, I'll write you back on what I find.
0
 

Author Comment

by:Roberto Madro R.
ID: 39973593
On the CR Server, under the "Process" tab, you have the option to set a DEFINED VALUE for the parameters, from there, every time the report runs it'll take these values into account, but the issue is, and in my case here, the parameters I have are date parameters and I need to supply them with dates, example (currentdate -5 to currentdate -1), something like that.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39973611
Unfortunately, as far as I know, you can't do that.  I know with the BOE product you can't.  CR Server is a scaled down version of it.

We got around that issue by coding those kind of date ranges into the report.

If you want flexibility to use a range like that by default and also allow the user to input a range of their own you could set the default value for the dates to be 1/1/1900 then test for that value in the selection.

Something like

If {?StartDate} = Date(1900,1,1) then
    {DateField} >= CurrentDate - 5  AND {DateField} <= CurrentDate -1
Else
    {DateField} >= {?StartDate} and {DateField} <= {?EndDate}

mlmcc
0
 

Author Comment

by:Roberto Madro R.
ID: 39976127
Have you ever called a Crystal Report from command line? and if so, were you able to supply its parameters?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 39976295
Crystal Reports doesn't have a command line option.

There are third-party tools that allow you to call them from the command line and pass parameters.  Kenn Hamady maintains a good list and includes a review

http://www.kenhamady.com/bookmarks.html

mlmcc
0
 

Author Closing Comment

by:Roberto Madro R.
ID: 40001918
Great tools and resources website, and although I know Ken Hamady, the links you provided were of great help. The request for automating that report has changed, but the fact that I'm aware of this resource now is great.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 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