on 12-09-2014 9:24 AM
Hi There,
I am a newbie to the Crystal arena, so please pardon if my questions are too basic in nature. In the report that I am trying to prepare, I want user to input various carton numbers, for which certain fields are required. Now, I want to assign a sequence number to each of those entries. I should be able to get the sequence number for each carton in the way it was entered. For example:
If the carton numbers that user enters are AAA, BBB and CCC in that sequence; I should be able to get 1 for AAA, 2 for BBB, and 3 for CCC. If the user provides a different sequence like AAA, CCC and BBB, the sequence number should change accordingly. Also, the total number cartons that a user can enter is not limited.
Is there any way this is possible in Crystal?
Please let me know if I am making sense of my question here.
Thanks for helping!
~Himanshu
Hi Himanshu,
You can get the value from the sequence of your parameter If you have set parameter accordingly
Para1, Para2, Para3 What ever values they give you have in sequence.
If you want how user enters the Parameters like Para1 first then Para3 comebacks to Para2
you cannot catch that sequence
For this you need to ask user on which sequence he\she gonna enter
Make new parameter with sequence give him the drop down values A-B-C, A-C-B, .... 2^3 = 8 combinations
so what ever sequence he selects make your case accordingly!!
Regards,
Rafaee M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mustafa,
Sorry for confusing you. The total number of carton numbers that a user can input is not fixed. Crystal should dynamically allocate a sequence number to all the cartons that user enters in a particular sequence.
For example
Actual Carton numbers | Crystal generated sequence# |
AAA | 1 |
BBB | 2 |
CCC | 3 |
DDD | 4 |
EEE | 5 |
FFF | 6 |
GGG | 7 |
HHH | 8 |
III | 9 |
JJJ | 10 |
III | 11 |
KKK | 12 |
Again, the total number of carton that a user can enter is not fixed, so this can continue further as per user entry.
Let me know if I am making sense.
Thanks for taking time!
~Himanshu
Hi Himanshu,
Try this please:
1) Insert a Group on the 'Carton Number' field
2) Create a formula with this code:
WhileReadingRecords;
numbervar i;
local numbervar j;
stringvar array arr := {?Carton_Prompt};
for i := 1 to ubound(arr) do
(
If {Carton_Field} = arr[i] then
(
j := i;
);
);
j
3) Go to Insert Summary > Choose this formula field as the 'Field to Summarize' > Choose "Maximum" as the Summary Operation > Under 'Summary Location', choose the Carton Group > Click OK
4) Next, go to Group Sort Expert > Choose 'All under 'For this Group Sort' > Under 'Based on', choose the 'Max of @formula' summary field > select the sort order as 'Ascending' > Click OK.
Hope this helps.
-Abhilash
Hi Himanshu,
I wonder how you create your query with dynamic request of cartons (3 or 1 or 10). How did you filter your records ??
If you wanna make Crystal Parameters you need to define before the generation of report. CR cannot create Parameters on fly.
One thing may be you can do, take input with comma separated values and break them.
AAA,ZZZ,TTT,KK
I dont thing I'm making any sense
Hi Abhilash,
To improve performance, consider adding after the j := i;
Exit For ;
You can see the logic at an FAQ I wrote about this here:
Hi,
Can you explain on below points to understand your requirement?
1. Which version of Crystal Reports you are using?
2. The parameter for carton, is it a multi value parameter (Means whether it accepts more then one value at a time)? If so, are you using/planning to use any static values for AAA, BBB etc? Please explain more on this parameter.
3. Say user enters AAA, CCC and BBB then are you looking for sequence values like 1,3,2 (assuming you assign 1,2 3 respectively for AAA, BBB and CCC)?
Thanks,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghvendra,
Thanks for taking time for answering. Sorry if I did not explain my requirement completely. Here are my responses:
1. I am using Crystal 9
2. Yes, Carton is a multi value parameter. I am not trying to use any static value for carton numbers; I am not restricting the total number of carton values entered by user and thus dont plan to use any static values.
3. User can enter carton numbers in any sequence. Crystal report should dynamically allocate a sequence number as per the sequence of the entries received.
Am I asking for too much? Please let me know if you still have any questions.
Thanks,
~Himanshu
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.