Printing a Database Record | Moodle v2.3

Printing a Database Record | Moodle v2.3

Francois Evans -
回帖数:6

The Database activity includes template settings for each record. Is it possible to retain that formatting to print out a record from a database? At the moment when I try, it prints out the whole web page (blocks & all).


The Database does export to Excel /Open Office spreadsheet, but I'm concerned that formatting will be lost. - Any advice?

回复Francois Evans

Re: Printing a Database Record | Moodle v2.3

Itamar Tzadok -

You can add css (to the css tab of the activity) to clean up unwanted parts when using the browser's print option. See http://moodle.org/mod/forum/discuss.php?d=207434&parent=906542 for a related example of the css. You can also use the ##export## tag (with portfolios enabled site wide) to allow exporting an entry to html file. hth 微笑

回复Itamar Tzadok

Re: Printing a Database Record | Moodle v2.3

Francois Evans -

Thanks Itamar.

In the css example you've given at the web link: http://moodle.org/mod/forum/discuss.php?d=207434&parent=906542

...you say: You need to check the actual selectors in the designated page as they may differ between themes. (My emphasis.)

What is an 'actual selector in the designated page' mean and how should I programme this? Thanks again for your useful tips. 脸红

回复Francois Evans

Re: Printing a Database Record | Moodle v2.3

Itamar Tzadok -

The selectors are those names which identify the page's html elements for css. For example div#page-header is a div element with id="page-header". If you have such an element on the page you can apply to it css by reference to that selector.

You can use firebug or your browser's web inspector to inspect the html and css of the designated page to find the selectors of the elements you want to hide in printing, and add the selectors to the @media print css rules.

See illustration of using firebug.

回复Itamar Tzadok

Re: Printing a Database Record | Moodle v2.3

Francois Evans -

Got it! Thanks Itamar. 微笑

F.

回复Francois Evans

Re: Printing a Database Record | Moodle v2.3

Frank Ralf -
See http://docs.moodle.org/dev/Print_style and http://docs.moodle.org/dev/Stylish#Print_style_for_Database_records

hth
Frank


PS:
It's a shame that this documentation is now buried in the Dev Docs 伤心