Click here to Skip to main content
15,882,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi my friends,

I want to create a report for "Order Bill" and this report will be printed on a roll printer, this mean that the page height of the report depends on the number of rows which are created dynamically (according to the items of the order)

In a word, I want to know how to configure the "Page Setup" to change the height of the report dynamically.

Thanks in advance !
Posted

 
Share this answer
 
v2
Comments
firas_hamzeh 19-Dec-11 17:08pm    
Dear Mika,
Thanks for answering but the links you suggested about fixed size paper to print on, and What I want is fixed width but dynamic height, no one spoke about that !
They just changed the Height from value to another one!
Wendelius 19-Dec-11 17:23pm    
Ok, most likely I misunderstood your question. When you define the report you set a repeating row in detail section? When the paper gets 'full', a page break is automatically added but if you define the paper height big enough wouldn't that prevent the page break from happening? I also added a link to PrintOptions
firas_hamzeh 19-Dec-11 17:30pm    
Dear Mika,
Let me give you the Goal, I want the report to be printed using roll printer !
if I set the Height to be fixed, then if the report has a little data then there will be a waste of the paper !
So if I set the Height to be dynamically, then a little data report will have short height and the rich data report will have long one (not to be divided into two different pages)!
Now the idea I'm looking for, is how to set the height to be dynamically?
Wendelius 19-Dec-11 17:45pm    
Ok, so it's more about calculating the height. Two options that come in mind:

1. If you know the amount of rows you're going to print and the line height you're using, define the height based on these. Something like:
number of rows * line height + some extra for space in the end

2. Define the paper height for 1 row only, no margins. This would cause page break for each row but if you don't have margins the print is actually continuous.

If you have headers and footers the option 1 could be more easy to implement.
firas_hamzeh 19-Dec-11 17:54pm    
What is the option to be set in order to allow me change the height of the "Detail" section after getting the exact desirable height.
I tried to change it for an exampled value and get an exception said that the height value is not true !
you dont need to configure high that crystal report extend the high automatically depending on the rows count
 
Share this answer
 
Right Click --> Design -> Page Setup !

It's very simple !
 
Share this answer
 
As you said consider Size of all static values except Rows is StaticSize
consider the line height is LineHight
in your code
set pageContentHeight as follows :
decimal lineHight = 4;
decimal StaticSize = 50

CrystalReport11.PrintOptions.PageContentHeight=CrystalReport11.Rows.Count()*lineHight +StaticSize;
 
Share this answer
 
Comments
bunzitop 20-Apr-15 4:44am    
PageContentHeight IS read Only... How can we set value to it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900