How to print crystal report with dynamic data at the printing

I have a crystal report:
1. It will have parameter which indicates, how many copies need to printed
a. orginal
b. duplicate
c. trplicate

these values will passed from a c# form.
Now I will showing the option checked in rpt viewer. But the trick is when the user clicks on print. The number copies should 3 if all are selected and the first print should show only original check box checked , second one duplicate check box checked and so on...
LVL 7
Maverick_CoolAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
You will have to print the report 3 times from the application changing the box checked through a formula change or parameter passed in.

Crystal has no mechanism to print a report multiple times.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LinInDenverCommented:
I've done something similar by placing copies of my report into a sub report. This only works if the original report itself does not contain sub reports.

Based on your parameters being true or false, you can suppress the sub-report/report section. Take care to insert new page after each section..

If it's a simple report, (i.e.: returns a single detail line), you can apply this same logic into your report detail section. You would end up with Detail A, B, and C. Replicate entries you have in A onto B and C. Insert page after each detail section. Apply conditional suppression based on your parameters.

I hope this helps.
0
Maverick_CoolAuthor Commented:
see, my requirement is that:
suppose i want all there copies, then in report it will show all three checked in the report

but while printing it show the corresponding one only checked
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

LinInDenverCommented:
You can drop your parameters onto the report, and use them in formulas..

i.e.:
if you have a single parameter with a drop down for Single, Duplicate, Triplicate...

Create 3 formulas, each can print out an X based on what parameter is chosen.

FormulaSingle
if {?Parameter} in ['Single','Duplicate', 'Triplicate'] then 'X' else ''

FormulaDuplicate
if {?Parameter} in ['Duplicate', 'Triplicate'] then 'X' else ''

FormulaTriplicate
if {?Parameter} in ['Triplicate'] then 'X' else ''

You can apply this same logic even if you have 3 separate parameters, with a Boolean.


FormulaSingle
if {?SingleParameter} = TRUE then 'X' else ''

FormulaDuplicate
if {?DupliParameter} = TRUE then 'X' else ''

FormulaTriplicate
if {?TriplParameter} = TRUE then 'X' else ''


This same logic can be applied on your conditional sections as well...

FormulaDisplayTriplicate
if {?TriplParameter} = TRUE then 'TRIPLICATE COPY'' else ''

Conditional Suppression of section:
if {?TriplParameter} = TRUE then NO ELSE YES

Does this help at all?
0
mlmccCommented:
Does you report have a subreport?
If not you could insert it into the report header 3 times.  You need to put each in its own section.

You could then edit the subreports to have the correct box checked or link it to the main report to have the correct box checked.

You could suppress based on a parameter.

mlmcc
0
Maverick_CoolAuthor Commented:
Guys!! Displaying in report is ok, I mean while printing. Showing the selected copies in parameter is ok.
What i intend to do if all three are select, though only 1 rpt is shown, while printing 3 copies should be printed automatically with selection of original box for the first copy and so on...
0
LinInDenverCommented:
I think what we are both suggesting will do just that - have you tried this? I understand this as you need to print 1,2, or 3 copies based on what a user chooses. Correct? If so, our suggestions should work, unless your report contains sub reports already.
0
Maverick_CoolAuthor Commented:
"LinInDenver" can explain me code a bit.
0
LinInDenverCommented:
what?
0
Maverick_CoolAuthor Commented:
What meant,
can you explain me your code and how will it help me to achieve my goal.
0
LinInDenverCommented:
i have already done this in previous posts. please try as I can't really think of another way to state what I've already described.
0
Maverick_CoolAuthor Commented:
I little confused!!
How will i control the printing with this. I am novice in crystal reports.
0
LinInDenverCommented:
Maverick,

You control the printing by doing conditional suppression on the sections you want to print (or not print) based on what the user chooses as a parameter. Right click on the section and enter formulas similar to what I described above.
0
Maverick_CoolAuthor Commented:
ok,
how set the no copies to 3, if all 3 parameters are set.
0
LinInDenverCommented:
please re-read above. i have explained this, so has mlmcc. create and insert sub reports in sections. conditionally suppress (right click on section on left hand side and choose section) based on if you want the sub report (aka COPY - 2nd and/or 3rd) to display.
0
Maverick_CoolAuthor Commented:
ok.
0
Maverick_CoolAuthor Commented:
hi,
can give sample code(simple dummy will do)
In which section shall i put. The whole report will be same except one line text.
0
Maverick_CoolAuthor Commented:
Can please explain what is this 'X' in formula.
Please provide dummy sample, with i text header changing for following
i am very beginner in crystal, and dont we know all control. so i request you consider that tell all setps
0
Maverick_CoolAuthor Commented:
Solution explanation was not adequate and No response, since long time
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.