Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameters prompts twice Post Reply Post New Topic
Author Message
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Topic: Parameters prompts twice
     Posted: 15 Jan 2008 at 1:07pm

Here is the requirement

 

1. Query should retrieve the orders between the two given dates.

2. Dynamic Parameter for State needs to be created.  (Orders from each State).  User has to ability to choose multiple States.

 

Lets go with simple command

 

Command :- select State, City, Order_no, Order_date

               from   Orders

               where  order_date between {from_date} and {to_date}

 

User will choose the dates, these dates applied to Command (Query).  The Dynamic Parameter shows the states based on the Query results set.

 

I followed the below steps

 

1. Designed Crystal report with "Command" and two input dates as Command Parameters.

2. Created a dynamic parameter with State.

3. Record selecting formula

    {command.st_code} in {parameter1}   // parameter1 is dynamic parameter for state.

 

 

Here is the problem.

 

Input Dates are prompting twice. First it prompt for executing the Command and second time appears along with the dynamic parameter.

 

How to resolve this.  Should I go with sub-report?  If yes, the orders have to be retrieved between the two dates (input parameters).  How should I link the main report dates with sub-report dates?

 

IP IP Logged
dkotenoglou
Newbie
Newbie


Joined: 24 Oct 2007
Online Status: Offline
Posts: 12
Quote dkotenoglou Replybullet Posted: 15 Jan 2008 at 1:59pm
Actually I use something similar to this.  I have 9 embedded reports in the same report all using a Date Range.  I might be telling you a clumsy way of doing it, but this is the way it works for me.

Create Parameter fields for the main report and the subreport.
Make sure they are the named the same.  (just easier) and the same settings.
When you import your subreport, in the preview window Right Click the subreport and select the option Change Subreport links.
The subreport Links window is composed of four quadrants.
In the upper left quadrant select your parameter field and click on the arrow to move it to the right.
Then in the lower left quadrant under SUBREPORT PARAMETER FIELD TO USE select your parameter field, you need to select the "2nd" option when you pull down the menu.

I am far from an CR expert, but this option saved me hours of work.

IP IP Logged
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Posted: 15 Jan 2008 at 2:24pm
Thanks very much for your reply.
 
I did the sameway as you said, but the subreport is displaying from 2nd page onwards.  First page displayed by the Main report.
 
How can I get the sub-report display on first page rather than 2nd page.
 
Thanks in advance.
 
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 15 Jan 2008 at 10:34pm
Try this
Go to section expert of main report and sub report and  uncheck  new page after, new page before in both the reports. 
Thanks
Savan
IP IP Logged
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Posted: 16 Jan 2008 at 8:11am

New page after, New page before are already unchecked for both Main and Subreports. 

Is there any other solution?
 
Thanks
VK
 
 
IP IP Logged
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Posted: 17 Jan 2008 at 8:33am
I got the solution.
 
Suppress "Report Header" in Main report, which does not to print Main report on any page.  You can suppress any other columns or sections in the Main report except the section where the Sub-Report is existing.
 
This is just display the sub-report contents but not Main report. 
 
Thanks for all  your help.
Smile
 
IP IP Logged
snyper19
Newbie
Newbie
Avatar

Joined: 15 Jul 2009
Location: United States
Online Status: Offline
Posts: 10
Quote snyper19 Replybullet Posted: 15 Jul 2009 at 9:14am
Hello All,

I was reading through this topic, I am having the same issue. I am new at Crystal Reports, we have a situation here where a report was printing 2 invoices on the same page but "magically" from one day to another that changed to one invoice per page.

we also have the main report and the sub-report and its linked right. any help to how can I change this back to two invoices per page.

Thank you in advance.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Jul 2009 at 9:20am
My guess...
some piece of dynamic information now has enough characters to make it too long for a field in the report that is set to "Can Grow" is True. This pushed the field to expand that row. That expansion now pushed the second invoice to be too large to fit 2 per page.
If this is the problem you need to expand the field that is "Growing" or set it to Not Grow.
IP IP Logged
snyper19
Newbie
Newbie
Avatar

Joined: 15 Jul 2009
Location: United States
Online Status: Offline
Posts: 10
Quote snyper19 Replybullet Posted: 15 Jul 2009 at 9:49am
I look through all the fields to see which ones have the Can  Grow and only the sub-report and  (msg_message) have the "Can Grow" checked. Although I do not thing that should be it, because the size of the invoice is 5 inches width x 2.5 or 3 inches at most of height. so there is a lot of space remaining at the bottom to print another invoice.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Jul 2009 at 11:02am
Given your description that it just started to happen one day without any chnages to the report I still would say somehting in the data changed to cause it. Maybe if the report is being sent to a new printer a font could be the issue.
Since you do not think the dats is the cause, I would start checking the Section Expert to look for problems with the New Page Before or New Page After or Keep Together.
IP IP Logged
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