This topic is locked
[SOLVED]

 Print Master & Details - one page

12/3/2014 6:32:40 AM
PHPRunner General questions
G
GregJ author

I have a master table Orders and two child tables Material and Labour. All I want to do is PRINT master / details on one page, the same way they show up on my display screens, like this guy http://www.asprunner.com/forums/topic/19207-one-master-and-multiple-detail-tables-on-print-page/ who really didn't get an answer to his question.
I'm on v8 of PHPR, yet it seems there is still no way, that I can find, to implement this without custom coding. Am I missing something?

Admin 12/4/2014

You have two options here.

  1. Use custom coding to display the additional info per suggestion in that forum post you mention. This is a not a perfect solution but sample code exists and it will get the job done.
  2. Use dashboards. You can display one master table and multiple details records this way.

G
GregJ author 12/4/2014



You have two options here.

  1. Use custom coding to display the additional info per suggestion in that forum post you mention. This is a not a perfect solution but sample code exists and it will get the job done.
  2. Use dashboards. You can display one master table and multiple details records this way.


I don't have a problem displaying the master & child data in a dashboard or whatever, I just can't figure out how to PRINT that same data. If I select one master record (or several) for printing then I need all associated child records to be selected as well and combined with the master on a printer friendly page.
The example code doesn't look like something I can use for the printer friendly page, but maybe I'm just not understanding what you're saying.

romaldus 12/4/2014



I don't have a problem displaying the master & child data in a dashboard or whatever, I just can't figure out how to PRINT that same data. If I select one master record (or several) for printing then all associated child records will be selected and combined with the master on a printer friendly page.
The example code doesn't look like something I can use for the printer friendly page, but maybe I'm just not understanding what you're saying.


Yes, in list page when you select a record ( master detail record) and than click the "print selected" button, Only master Page will be printed.

G
GregJ author 12/4/2014

Yes, in list page when you select a record ( master detail record) and than click the "print selected" button, Only master Page will be printed.
=========================
Yes, that's my problem.

B
bobotoh 12/5/2014

i also have similar problem with print master detail record from master page

J
jackwood 12/5/2014

Just Create Custom View at Master View Page.

Use Relation in Table Link Properties between Master and Detail, and Checklist Display Child Records on View Page.

So The Scenario, When I Click View Button at masterPage List The Customm View Page will show in New Tab, Use target="_blank" in the View Button.
Nuhun

G
GregJ author 12/5/2014



Just Create Custom View at Master View Page.

Use Relation in Table Link Properties between Master and Detail, and Checklist Display Child Records on View Page.

So The Scenario, When I Click View Button at masterPage List The Customm View Page will show in New Tab, Use target="_blank" in the View Button.
Nuhun


Viewing is not my problem. PRINTING is my problem.
Right now I can select one or many records on my Master list page. I can hit 'Print Selected' which then PRINTS each of the selected Master records on its own custom page. I just can't get the associated Detail records to show up on that same page. I have cut and pasted the 'child record code' from the View page into the printer friendly page...no go. I have examined the Invoice template (which I purchased) to see how it works but it appears to be doing more or less a printer friendly screen print of a single invoice, which is OK if that's all you need.
Printing Master / Detail reports is a very common scenario. Surely someone must have been down this road with PHPR many years ago. If I can VIEW Master & Child records together why can't I PRINT them together? I've been looking for the tick box for 'Show Child Records' on the Printer Friendly page, the same as there is for the List / Add / Edit / View pages, but I haven't found it yet.

Admin 12/8/2014

You need to post some screenshots of what "master / details on one page" means. It looks like everyone's definition of this is different and some visuals can help here.

romaldus 12/8/2014



You need to post some screenshots of what "master / details on one page" means. It looks like everyone's definition of this is different and some visuals can help here.


List Page :


Print Page :

G
GregJ author 12/8/2014

[quote name='romaldus' date='08 December 2014 - 11:29 AM' timestamp='1418052588' post='76385']
YES! Perfect! Thank-you romaldus.
My Master table is Orders with key field ordernum. My detail tables are Material and Labour with same key fields as Master. I've been playing with the code snippet Sergey pointed me to ( http://xlinesoft.com/phprunner/docs/show_list_of_customer_orders.htm ) but I can't figure out what to replace [editid1] with to make it work for the records selected on the List page.
I'm no PHP expert, just muddling my way here. Maybe there's an easier way to do it?

G
GregJ author 12/9/2014



Here is a step-by-step tutorial for you:

http://www.asprunner.com/forums/topic/22828-printing-master-and-details-records-together/


IT WORKS!!! Great tutorial, thanks for taking the time to do this Sergey.
One final tweak. How can I insert a page break so that each Master / Detail set prints out on separate page instead of one long report?

G
GregJ author 12/10/2014



Try this:

http://lvsys.com/how-to-add-page-breaks-to-html-in-articles


This works in normal html but PHPR monkeys with it when I rebuild the app.
I'm editing the printer-friendly page using the HTML view (vs Visual) and placing the <p><!-- pagebreak --></p> line just above the [END row grid] where I know it works. When I rebuild the app (or just switch back to Visual editor) PHPR moves that line of code from there and puts it in text form (the word pagebreak) near the top of the html body. I have tried everything I can think of to get the page break to stay in the right spot but PHPR consistently re-writes it and moves it.
My last attempt was to add this custom css: H6 {page-break-after: always}. I was able to get the line <h6>pagebreak</h6> to stay put for long enough to test it, and it worked, then on the next rebuild PHPR messed that up too.
What can I do to stop PHPR from messing with this line of code?

Admin 12/10/2014

Actually in PHPRunner 8 there is a very simple solution to this. Proceed to 'Choose pages' screen, click Printer-friendly options and choose one record per page. This is it.

G
GregJ author 12/10/2014



Actually in PHPRunner 8 there is a very simple solution to this. Proceed to 'Choose pages' screen, click Printer-friendly options and choose one record per page. This is it.


Absolutely right, works like a charm. Thanks again Sergey.