• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 889
  • Last Modified:

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...
0
Maverick_Cool
Asked:
Maverick_Cool
  • 10
  • 7
  • 2
2 Solutions
 
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
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 10
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now