-1

I am using PHP and CodeIgniter. I have a page that containing the data from database and \ search option in that screen. I'm designing the new page for print the same data. How can I link the new page for print? For example:

View page:

enter image description here

I want to print the display result in another new page, like:

enter image description here

How to get the result from screen 1 to screen 2?

halfer
  • 19,824
  • 17
  • 99
  • 186
user3265980
  • 39
  • 1
  • 10
  • 1
    I really don't understand what you want, clarify with some code please? – Ariën van Helden Jun 13 '14 at 10:03
  • could you able to understand, i have a list view page with the search option.. i want to print the search result in another page.. – user3265980 Jun 13 '14 at 10:11
  • Still vague, are you trying to add every search result in a new page, or do you just want all the data from the database in another view without an searchfield? – Ariën van Helden Jun 13 '14 at 10:14
  • actually i want to print the result in new page whether only if click the printer icon in top of the table. – user3265980 Jun 13 '14 at 10:21
  • If I understand you correctly, you want to add a search result to another page when you click on the printer icon at the top of the table? – Ariën van Helden Jun 13 '14 at 10:24
  • Well, what you could do is when you click on the printerbutton the printer is sending the ID from the result you want to print to another controller and in that controller get the results again based on the ID and then show this result in another view. – Ariën van Helden Jun 13 '14 at 10:31
  • 1
    here is your reply http://stackoverflow.com/questions/16894683/how-to-print-html-content-on-click-of-a-button-but-not-the-page – Saqueib Jun 13 '14 at 10:33
  • Thank u so much for your reply. I'm searching many fields like date, name, id.... So, i must send the all the details whatever i'm search and get the result again.. if i understand correctly... – user3265980 Jun 13 '14 at 10:37

1 Answers1

2

I think you want to redesign (alter) the presentation when you are printing that page/content and in this case (if really this is the case) you may add a different css styles for print media, for example:

<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<link rel="stylesheet" type="text/css" media="print" href="print.css">

if you add another CSS file and style those elements differently in that CSS file then those styles would be applied only when the pages is being printed, so you may add in that CSS:

#search_bar_at_top {
    display:none; /*Hide the search bar*/
}

Or using in the same CSS file using media print:

@media print{
    #search_bar_at_top {
        display:none; /*Hide the search bar*/
    }
}

Check more on MDN and other helpful articles:

  1. How To Set Up A Print Style Sheet

  2. Print Different

  3. CSS Media Types Create Print-Friendly Pages

halfer
  • 19,824
  • 17
  • 99
  • 186
The Alpha
  • 143,660
  • 29
  • 287
  • 307