0

Printable version of ZK

asked 2010-03-29 19:16:30 +0800

judacoor gravatar image judacoor
280 1 3 8

Hi everyone,

I am currently trying to generate a printable report using a zul page.

I generate a couple of DIVs using zk Grid and Labels. Everythink seemed fine from the internet browser, until I tryed to print the page with a pdf generator.

As I was saying, from the internet browser looks fantastic, but when I print to pdf then the Grids appear to disconfigure their width, so from my 2-column grid (in zul) I only see the left column in the pdf. So it looks hideous!

I think the possible solution would be to use a ZHTML and generate the printable version in HTML and paste it.

Any opinions?

Thank you!

judacoor

PS. I tryed with the jasper reports plugin, but it is a little too complicated for me... :(

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-03-29 19:39:19 +0800

samchuang gravatar image samchuang
4084 4

Hi

could you provide zul file example code for this problem ? by the way, which zk version do you use ?

link publish delete flag offensive edit

answered 2010-03-29 21:56:23 +0800

judacoor gravatar image judacoor
280 1 3 8

Thanks for you reply!

I'm using ZK 3.6

The code is basically this:

1. Generate a Div[] with all the info I need, one of them is the following (Using labels I build the rows, then a grid, then I put the grid into a div and return it)

                                Grid grid = new Grid();
		Columns cols = new Columns();
		Column col1 = new Column();
		col1.setWidth("40%");
		cols.appendChild(col1);
		cols.appendChild(new Column());
		grid.appendChild(cols);
		grid.appendChild(rws);
		
		Div theDiv = new Div();
		theDiv.appendChild(grid);
		
		return theDiv;		


Then I have the zul:
<?init class="npBO.support.SecurityCheck"?>
<zk>
<window id="impHis" use="npBO.imp.ImpHis" border="none" width="99%">
	<vbox id="centerVbox" width="99%"/>
</window>
</zk>


And what I do, is take the Div[] from the java code above, and:
centerVbox.appendChild((Div)result[0]);


Because in this case I only need the div[0].

I hope this helps, I am sorry for not posting the entire code, but there are like 10 - 15 classes :S

Thanks in advance for your valuable help

link publish delete flag offensive edit

answered 2010-03-30 20:26:11 +0800

samchuang gravatar image samchuang
4084 4

updated 2010-03-30 20:26:34 +0800

Hi

I heard this kind of problem on Safari, which browser will cause your problem ? or All browser has the same problem?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-03-29 19:16:30 +0800

Seen: 382 times

Last updated: Mar 30 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More