Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Change a query on a crystal report at design or runtime

Posted on 2013-01-31
3
Medium Priority
?
632 Views
Last Modified: 2013-01-31
Hi

Is it possible to change a crystal reports query at design or runtime?

for example, I have a single report which can be used for a multitude of reports, with just the change of on parameter.  Like, employee birthdays, if I want to get all employees who have a DOB in january, the query is the same for every other month aside from the date...

I am using MS Access as the datasource in a c#2010 winforms application

I tried using [month] in the query as a parameter, but that accepts a numeric value.. which is ok, but I would prefer for the user to have a dropdown list of months with January, February and so on... and for the query to feed from that... can this be done?

Cheers

CD
0
Comment
Question by:cycledude
[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
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 38839037
I'm assuming you mean you are using the Add Command feature to base the report on a sql command. (If not you will have to explain what you mean by 'change the crystal reports query')

In the dialog where you create the sql Command you have an option to create a parameter.

Say you create a new parameter of type string called MyMonth and set it to default to January.
 You can then then incorporate the parameter into the sql command....

like...

Select * from Orders where Format([Order Date], "mmmm")='{?myMonth}'

In addition having created the parameter this way,  you can then go into the parameter fields in the main Crystal Field Explorer and modify the parameter - add a list of month names as the possible values.
0
 

Author Comment

by:cycledude
ID: 38839228
hey peter, thanks for the input


You just saved me a load of hassles!

Cheers
0
 

Author Closing Comment

by:cycledude
ID: 38839232
thanks dude
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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

647 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