How to set up print feature in SuiteCRM

I would like to how to add the print icon in suitecrm; like how it is in SugarCRM. How can I this, just to allow for the user to do a print. At the moment if I right click and it gibberish for the relationship fields.

Sorry, I donā€™t know how it is in SugarCRMā€¦

Which view are you trying to print?

Would it be better to make a Report in the Reports module?

The user would like to print the case module; the detail view.

I see. Printing that from the browser seems to have all the information except the subpanels.

See if you can get something to look good from the reports module. If not, I think you need to create a custom entry-point to lay out the information your user requires for printing. Itā€™s simple, but itā€™s a code customizationā€¦

It has the information but the relationship fields shows gibberish. Could you assist with the custom code, please?

Can you share a screenshot (here, for example: https://pasteboard.co ) ? I donā€™t see any gibberish and I wonder if something in your screens is broken.

The custom code could be a custom entry-point:

https://docs.suitecrm.com/developer/entry-points/#_creating_an_entry_point

Inside that, you access the database with SQL and dump good-looking HTML onto the screen, something straight-forward enough for the browser to print adequately. The advantage is that you can tailor it to what your user really wants.

Hereā€™s a link to what the case looks like when it is printed https://pasteboard.co/IkTXSfU.jpg

I donā€™t get that on my Firefox.

Which browser are you using?

Can you try a different browser, just to see if it is the same?

In the browser that doesnā€™t display well, do you get any Javascript errors in your browserā€™s developer console?

No I donā€™t get any. Iā€™m not sure why you donā€™t get that on firefox and it is working for me.

Sorry, I canā€™t exactly make out the answers to my all questions from your brief answerā€¦

I understand you donā€™t see Javascript errors, but the rest? Thanks

iā€™m using firefox and Iā€™ve tried other browsers and is the samething. Where action=ajax is the part Iā€™m talking about; Iā€™m sure if it because it is a relationship field.

Please try a few Repairs from Admin / Repairs:

  • QR&R
  • relationships
  • anything Javascript related

On the first post you wrote ā€œAt the moment if I right click and it gibberish for the relationship fields.ā€

What do you mean you right-click? Then select what?

Do you see the broken bits immediately when you enter the detail view, or after doing something else? What? (maybe selecting print preview?)

Sorry I meant to say when I right click then click print, it shows the ā€˜gibberishā€™, but in the details that is not shown only when it is being printed. And it is also shown in the print preview; even after the repair

I could reproduce this now. Itā€™s the ā€œprintā€ stylesheet (thus only visible on ā€œPrint Previewā€ or ā€œPrintā€) that has a ā€œfeatureā€ to display the links. So the Account is a link and it shows you the Account name, and also what that links to (which is computer talk and human ā€œgibberishā€ :stuck_out_tongue: )

I will open an issue on Github to ask for this to be improved. It is related to a previous issue (https://github.com/salesagility/SuiteCRM/issues/1338)

Work-around:

Create a Bookmarklet to sanitize the page before printing.

In Firefox, make a new bookmark (you can put it in the toolbar on top) and call it for example ā€œPrepare to Printā€ and make the address (or Location) like this:

javascript:(function(){r='@media print{a[href]:after {display:none !important}}'; var s=document.createElement('style'); s.appendChild(document.createTextNode(r)); document.body.appendChild(s); })();

Once you are in the page you want to print, pressing that should fix it.

EDIT: I opened a new Issue for this: https://github.com/salesagility/SuiteCRM/issues/7465

Iā€™m not sure if I understand properly what it is that I should be doing

If you want to try the work around, in Firefox

  • click Bookmarks menu

  • in that menu, you want to create a new bookmark, you can right-click any folder or any toolbar and select ā€œNew bookmarkā€

  • give it a name like ā€œPrepare to Printā€

  • in the ā€œLocationā€ box, paste that ugly code I gave earlier

Now your bookmark is created. It is called a ā€œbookmarkletā€ because it contains an action to be applied on the page you are visiting, when you select that bookmark.

So

  • go to the page you want to print in SuiteCRM
  • select the bookmarklet. You wonā€™t see anything happen, butā€¦
  • now select print and it will not contain any links

I hope this helps

Ok that I got that to work but what about a long term fix for other users?

For that, follow the Issue I opened (link is above).

Thanks for reporting.