Page 1 of 1

Print preview not displaying as intended

Posted: Wed Dec 07, 2011 3:25 am
by jasnick
Using 1.10.2

Need to have a table on a page print exactly as it looks online with colours and borders.

CMSPrinting module - have added styling requirements to "Override print stylesheet". Do I need to do anything more with this or is it part of the Print css?

Page in question is "newcomp".

Override print stylesheet:

body.newcomp {font-family:arial; }

#main,
#table,
#table th,
#table th.col1,
#table th.col2,
#table th.col3,
#table th.col4,
#table th.col5,
#table td.col1,
#table td.col2,
#table td.col3,
#table td.col4,
#table td.col5,
{
display:block !important;
width:100% !important;
padding:1em !important;
}

#header,
#header h1,
#header h2,
#header img,
.nav,
#breadcrumbs,
div.hidden,
#search,
.cms_form,
#footer,
#news
{
display: none !important;
}

When I click on the print-friendly page icon it certainly shows only the table but there are no borders to the table or cells and I need them to make the page easier to read.

Then when I click on Print Preview in the browser, the page that comes up is the usual sort of printer page with no background colours and no grid for table unlike the page I see when I use the printer icon which at least has the colours correct but no borders.

I have {cms_module module='CMSPrinting' text="Print" showbutton="true"} on the page in question and the Print css attached to the main template for the site.

What am I doing wrong?
Page is a test page, active but not visible on line so will add screenshots.

Thanks

Re: Print preview not displaying as intended

Posted: Wed Dec 07, 2011 9:48 am
by spcherub
This is most likely a CSS issue, so it is hard to give you advice without seeing how your page CSS is setup. Anyway you can provide a link to the test page?

-S

Re: Print preview not displaying as intended

Posted: Wed Dec 07, 2011 11:34 am
by jasnick
Thanks spcherub

I appreciate your time.

I have transferred the data to the correct page - the nav doesn't work properly since I upgraded but you can access the page by using the footer navigation: Competitions is the page.

http://www......com

Thanks

Re: Print preview not displaying as intended

Posted: Wed Dec 07, 2011 11:56 am
by spcherub
The problem is that the styles for the table (borders, fonts, etc.) are being defined in your default stylesheet(s) attached to the regular page template, but are not being inherited by the print template.

Assuming you have one stylesheet attached to your page template, go into the stylesheet edit and check the "Print" option under Media Type. This will force the inclusion of the default stylesheet into the print template and should fix your problem.

If you have more than one stylesheet attached to your page template and your CSS definitions are spread across them, then make sure you mark all of them for the "Print" media type as described above.

Hope this helps.

-S

Re: Print preview not displaying as intended

Posted: Wed Dec 07, 2011 2:03 pm
by jasnick
Thanks spcherub

I've added Media type: Print to all stylesheets. I have only the one main stylesheet but also use the Calendar, News and Formbuilder stylesheets so added Print to those as well.

It didn't make any difference. I can understand what you are saying - my styles are not being recognised.

How do I get the print template to recognise them? Is there something I have not done? I am just using the standard template that comes with the module. Do I have to do something with the link template?

Should I do another stylesheet altogether instead of using the override one?

Thanks!

Re: Print preview not displaying as intended

Posted: Wed Dec 07, 2011 2:38 pm
by jasnick
My last word for tonight - am thinking this is never going to work as the coloured backgrounds for some of the cells can't be styled for print as they are random. Its recognising the two different colours for the text but not the backgrounds.

Am thinking: a couple of screenshots of the table, join them together in a Word doc then turn it into a pdf. Tried with one screenshot and I think it would be quite acceptible.