Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Re-open query to edit Post Reply Post New Topic
Author Message
rmbennett
Newbie
Newbie


Joined: 24 Jun 2010
Online Status: Offline
Posts: 2
Quote rmbennett Replybullet Topic: Re-open query to edit
    Posted: 24 Jun 2010 at 4:40pm
Am new to CR V10 and can't figure out how to re-open my report SQL query to modify something (add a parameter). Tried to find in books, on-line, etc. Would appreciate help with this simple question. Thanks.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 26 Jun 2010 at 7:46am
Hi
 
You can't modify the report SQL Query in Crystal unless you are using command object, the Sql Query is created on the number of fields selected and if any record selection forumla used in the report ...
 
*Open the report and do the following
 
*You can veiw the sql query, Go to Database in Main Menu the click Show Sql Query.
 
*To Add Parameters Go to View in Main Menu and click Field Explorer once you do that on the right you can view the Field Explorer Window with all the different option such as Database Fields,Formula Fields... etc
 
*Select Parameter Fields right click and select New to create New parameter.
 
Cheers
Rahul
 


Edited by rahulwalawalkar - 26 Jun 2010 at 7:46am
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 26 Jun 2010 at 9:17pm
additional info:
 
if your report using a Stored Procedure (SP) or View with parameter to collect some data then you need to modify the SP/View it self.
After you finish then you need to verify your report
 
here is the steps:
*To Check if your report using SP or View
- click on Database menu
- click on 'Set Datasource Location...'
  here you'll see your ODBC name and the SP (or View)
- expand your SP/View, to see the real SP/View name
 
till here you can open and add parameters on your SP
 
*To verify your report
- click on menu 'Database'
- click on 'Verify Database'
  in this stage CR will sync with the SP/View (if there are some changes on fields / params, etc.)
 
 
hope it help.
 
Emir W
IP IP Logged
rmbennett
Newbie
Newbie


Joined: 24 Jun 2010
Online Status: Offline
Posts: 2
Quote rmbennett Replybullet Posted: 27 Jun 2010 at 4:20pm
Thank you Emir and Rahul,
 
When my consultant and I created this report, we took a complete MS Access SQL passthrough query that I had written for an Access Report and dropped it into a dialog. Then set a couple of parameters. We used an ODBC connection to the SQL server. This defined the data set for the report. I'm really sorry I don't know this better, but now I want to get back to that SQL query that I used, and add another parameter.
 
Emir's advice seemed to take me to stored procedures in the SQL database, but I'm looking for the SQL query that I wrote and put into Crystal. Rahul: are you assuming my report design created the SQL script. In my case I used a script I had previously designed. Now I want to further edit it. I hope this makes sense. Thank you. 


Edited by rmbennett - 27 Jun 2010 at 4:22pm
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 27 Jun 2010 at 9:33pm

for editing the SQL from CR all you can do only:

1. add/remove table(s)
2. change the link between table(s)
these can be done from 'Database Expert'
 
and, change the data restrictions (where clause) from Report-Selection formula.
 
you can also add a parameter from CR by:
1. right click 'Parameter Fields' in Field Explorer
2. click 'New' and put the Parameter name, Type of the parameter, and other options on it.
 
in case you using a stored procedure then you can add parameter(s) from your stored procedure as my previous reply.
 
 
hope it help.
 


Edited by Emir_W - 27 Jun 2010 at 9:36pm
Emir W
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.047 seconds.