Why is my report only filling up the top 2.5 inches of each browser page?
Why is my report only filling up the top 2.5 inches of each browser page?
(OP)
Why is my report only filling up the top 2.5 inches of each page in the browser?
I would like to attach an example, but the attachment option is not working. I've estimated that the output should fill approximately 7 (not 2.5) inches if printing to a landscape formatted report.
I have tried looking at the "Inspect Element" tool within Google Chrome (and FF), but can't seem to identify what CSS parameters are causing this behavior. Most of the parameters that I've tried to change are in the "Page" div class, such as: margin-top, margin-bottom, height, padding, etc.
Can someone point me in the right direction to fill up the entire page with output (not just the top 2.5 inches of every page)?
Thanks,
Dave
I would like to attach an example, but the attachment option is not working. I've estimated that the output should fill approximately 7 (not 2.5) inches if printing to a landscape formatted report.
I have tried looking at the "Inspect Element" tool within Google Chrome (and FF), but can't seem to identify what CSS parameters are causing this behavior. Most of the parameters that I've tried to change are in the "Page" div class, such as: margin-top, margin-bottom, height, padding, etc.
Can someone point me in the right direction to fill up the entire page with output (not just the top 2.5 inches of every page)?
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Attached is an HTML example of the output displaying data on only the top 2.5 inches of every page.
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Tell us too what browser version and operating system you are using.
Look in your css for @media print rules. And for page-break-* rules. If you are using heights for divs ensure that you understand unit conversions. Or use ex as a unit. If you are using tables rather than stacked divs then consider specifying thead and tfoot elements and giving them proper style declarations for their type (so that they appear on every printed page that has the table on it).
RE: Why is my report only filling up the top 2.5 inches of each browser page?
To just avoid the premature page breaks, you can remove this :
CODE --> CSS
But then the report will look dumb because the 3 pages will closely follow each other, so better replace it with this :
CODE --> CSS
Even so, the report will be ugly as each of its page will still have its designed header and footer, though they all be on the same paper. But that is hardcoded that way in the document's structure, so not something to be fixed with CSS. I would suggest to take a look at the generator software's configurations too.
Feherke.
feherke.ga
RE: Why is my report only filling up the top 2.5 inches of each browser page?
looking at the source code it appears that the report generator is closing the page divs prematurely. So the whole issue may be predominantly a matter of a bug in the server side coding.
I have not tried this but intuitively this kind of construct might be better
1. use tables, thead, tfoot and tbody instead of floating divs. this is not inappropriate as your data is tabular.
2. don't impose page breaks arbitrarily other than at the end of a table where you _must_ have physical separation between records.
3. some browsers don't allow page-break declarations for non-block elements. So you may want to wrap all table cells in divs.
CODE
For page footers/headers you might want to look at the @page @position rules. You may need to fill the content of each page footer with javascript however as you would not know necessarily how many pages each report would fill (if you wanted page headers/footers to be dependent on the page level). Remember you can set the content of a header/footer by css
CODE
If I have time tonight I will see whether your structure is easily re-renderable into this kind of format.
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Feherke, I changed ".page:not(:first-child) {page-break-before: always}" to ".page:not(:first-child) {margin-top: 50px}", but it did not seem to change the output. Is there some sort of hard page break that I just do not see?
Jpadie, I have never used THead, TFoot, or TBody, but I am open to the idea. Will this effect my other reports?
SpamJim and ChrisHirst, thank you for your earlier posts. My original posts and your responses were accidentally deleted by Tek-Tips (they informed me that they have fixed this issue, but I was not able to read your replies ... my apologies).
The formatting issue (only displaying records in the top 2.5 inches of every page) seems to only effect my summary reports. When I choose to display this report with detail records, then all of the page is properly filled with records. To my knowledge, all formatting is the same for both the detail and the summary formats.
Thank you all for your assistance.
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
the core issue is that your generator is inserting the page divs at the wrong place. it's not a css issue (although there may be one of those too) but that your server side code is closing the div in the middle of a report.
what server side code are you using?
RE: Why is my report only filling up the top 2.5 inches of each browser page?
To clarify, that will only allow all three pages to be printed on the same paper, but will not rearrange the content into a single page.
I attached how it appears in FireFox 36.0.1's Print Preview after the modification. Not tried to actually print it, but according to my experiences the real print should look like the preview.
Feherke.
feherke.ga
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Jpadie, I am creating the CSS using C#, and the data is coming from MySql (is this what you meant by asking what server-side code I am using?). It makes sense that the report generator is inserting the page divs at the wrong place, but I thought that this could be manually changed within the browser (in order to see format changes before doing any recoding).
Feherke, I see what you mean about the pages being grouped on the same page ... this included the report headers and page headers 3 times (even though it did indeed fit on one page). You are correct ... this is not what is needed. As both you and Jpadie suggested, the problem is probably within the Report Generator.
Still, I thought that this formatting could be manually changed within the browser (in order to see format changes before doing any recoding). Does this make sense?
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
RE: Why is my report only filling up the top 2.5 inches of each browser page?
CODE -->
Please let me know if this is what you requested.
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
i suspect it is in the writeToPage function.
assuming this is relatively anodyne the my next presumption is that the issue is in the way your query data is being returned to the C functions. you have not provided that layer.
have you considered sending the data as json and allowing a javascript reporting engine to take the burden of rendering a table meaningfully?
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Thanks ... I will dig into the code to see what I missed sending ... specifically a "writetopage" function. I am away from my desk, but will return in an hour and will find and send the missing code.
Regarding sending the data as JSON ... I had not considered that. What are the benefits and drawbacks?
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
As you requested, here is the function for "WriteToPage" (near the bottom of the code below). I've also included a few other functions that have to do with page formatting (ex: function "BeginPage" may be causing an issue, although the report displays perfectly when I run a report showing detail lines):
CODE -->
Thanks,
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
If you are using Letter paper in Landscape then you have 8.5inches. subtract 0.5 from each end and you are at 7.5.
so not sure why you are setting to 6.5" in BeginPage.
also you can tell that something is going wrong as if you have a look at the page-footer inline style it discloses that, at that point, the PageInchesRemaining is only 0.005". and later at 0.3 (which is in itself interesting as that suggests that the inbound contentInches is greater than that - so probably one of the groupFooterMarginInches array).
for debugging I suggest that you footprint the WriteToPage code. In this case I'd suggest adding a hidden div that contains the contentInches and PageInchesRemaining. Try adding this and then post back the renderered html (or upload it like last time).
CODE
My suspicion is that the function is being called more often than you expect, potentially for blank content lines. although then I'd expect to see more linebreaks in the source-code <scratching head>
RE: Why is my report only filling up the top 2.5 inches of each browser page?
CODE
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Thank you for your assistance. I am excited to implement your suggestions as soon as possible (probably tomorrow, since I am currently out of the office).
Much appreciated!
Dave
RE: Why is my report only filling up the top 2.5 inches of each browser page?
CODE
RE: Why is my report only filling up the top 2.5 inches of each browser page?
Thank you so much for your input, and my apologies for not giving you an update earlier. I have not yet had time to implement your solution since I was temporarily pulled onto a different project that is taking longer than expected. I should be able to get back to my original project and your solutions by next week.
I am excited to try out your suggestions.
Thanks again,
Dave H