So I have a report that generates multiple tables from a database, and grouping them by 'owner' creating a new table for each 'owner'. It does this dynamically using Angular/PHP/Js.
In the print preview I want each table to have it's own page(tables shouldn't really go beyond the length of a page) so I added the page-break-after value to each table.
My issue now is that the tables are cut off. I have the option for landscape, but unfortunately they are long tables, and still get cut off.
I am looking for a solution for the tables to be re-sized when
printed out.
Here is a sample of the table being cut off
I have searched both here, google and w3 for a method that re-sizes the tables to fit the print preview but so far have had no luck.
Suggestions?
You can use a media query for this. Target #print and do some trial and error to get it to look correctly when viewing in print preview. I'm assuming you haven't already done this.
https://css-tricks.com/css-media-queries/
Related
I'm looking for some advice, to be specific in the generation of data using phpmyadmin and mysql.
I have a website (local) that register ideas from different people, those ideas are registered in a database.
I'm able to retrieve all the data into a table that i have in a reports section, the problem is that when there are at least 1500 records it gets slow (i know the amount of data printed in the table makes it slow).
I generate some charts from that data using charts.js, which is good until there are a lot of records in the webpage. (I tested putting 5000 records, 1500 records, and 2000 (which is the max amount we get with this ideas)).
So, what do I want to know?
What is an efficient way of showing that amount of data to the user without the page getting extremely slow.
What is the best practice to generate charts, from a table that gets its data from database or directly getting the data from the database, if so, which chart framework would you recommend?
I have read about pagination, to retrieve just part of the data by page, but my export to excel use the table data to export it, so it would ruin the exporting option.
I'm really sorry if this is no place for asking this programming question, but I cant think of a way of doing this in an efficient way.
Here is a picture of part of my webpage (in top you can see some charts), (below you can see some records of the table), the middle is just some report generation from the date/week and the export to excel option.
Tech used in the webpage:
PHP
JQUERY
HTML5
CSS3
mysql
Any help will be appreciated.
I'm developing a WebApp in which I take an invoice converted from PDF to HTML, then parse the invoice lines.
I have a div in my main window which displays the contents.
But when I display the contents from the invoice in that div, all the contents appear overlapped.
In the converted invoice there is no table, only divs with absolute positioning. I can't make it any other way at least with this aproach, because that's the way the converter works.
So, as a solution I'm converting from "div to table", trying to decide when there is a change of row or not, based on the top parameter from the corresponding div.
However besides the invoice data, I also have the invoice header. I'm having difficulties to decide if the table is the same or not.
But so far, I think the solution passes through making 3 tables, one for the company logo, one for the header, and one for the data.
But I need all these tables to appear in the correct positions and with the correct sizes.
At the moment, I'm not allowed to paste invoice examples, and as I'm stuck in an early stage (close to the algorithm stage). I don't think any examples of my code and of the invoices could help anyone to understand the situation better.
But I promise to update this with examples soon.
As an alternative solution I could parse the PDF myself, but I haven't found a way to do it so far.
I'm using PHP to make the WebApp and verypdf pdf2html to make the conversion.
I know with that little information, is hard to get help.
Any ideas are welcome.
How about trying to cure the overlapping itself. For example you could strip all the styling information from the DIVs after the PDF is parsed into DIVs. Then you can apply your own styles.
It might be useful to know if all the invoices are in the same format/arrangement, or not.
I need to create a pdf with four equal length columns across the page using dompdf.
I have tried to do this however I can't work out how to correctly set the widths of the columns. It always ends up cutting the last column off.
How can I render a table with a fixed width across the entire PDF page with four equally wide columns?
Dompdf has issues with tables, page breaks and image display..you can see on their own issues website..Here
I use fpdf, and its really simple to use and consistence in design Check here for simplicity in table display in fpdf
Ok it looks like all I need to do is set the table width to auto or 100% and let the columns scale across the page automatically without setting their widths.
I have four fields in my mysql table and in total there is around 85 rows of information. Now when any user clicks on a button, I want it to retrieve all the data from the mysql table and print those out on a A4 size paper.
For 85 rows of information it probably going to need more than one page, so in that case I also want it to display the page number out of total number of pages- like 2 out of 10. I have tried googling it but haven't found any good tutorial.
Would you please kindly help me how to do this ? Just for your information- I am using Codeigniter.
Thanks in Advance.
to my knowledge, there is not a way to instruct the web browser (html) how to print to specific device. you can play around with the media: print css commands, but that might not be easy. were it me, i'd use FPDF http://www.fpdf.org/ or something similar to create the results as a PDF - that way you can completely control the layout and paper size.
I'm using DomPDF to generate invoices in a project I'm working on.
I've done so several times before and never had any trouble but since today however It got so slow that the maximum execution time gets reached.
I've confirmed that this happens because of: $dompdf->render()
I'm generating some tables to display the data in. but is seems to find this table quite difficult. Does anyone know what could be the problem?
dompdf and my table can be found: http://pastebin.com/G585VQma
(figured I'd put it on pastebin to save some space)
dompdf doesn't support splitting table cells through pages, so you need to change the tables with cellspacing="10" into block elements like divs with the same styling, or at least not put the tables with many lines inside of these tables.