Jump to content
TNG Community
Leo te Braake

Wanted An image and free text to include in a report

Recommended Posts

Leo te Braake

I found Ken Roy's Report Footer Mod, which is indispensable, but not what I had in mind: it turned out to be more a Table Caption Duptication mod in my eyes (but hey, I am not Anglophone...).

The Description field under the title is good, but that must to be just a few lines. A small image in that box could be handy. (And the word "Description: " should not be IN the text.)

For a few of my reports, in a text after the table I would like to give some background info. It could easily be half a page. Sometimes a beatyfull photo asks for inclusion, max half a page as well.

Anyone who could build that?

Leo

Share this post


Link to post
Share on other sites
Robin Richmond

Next to the "x to y of z" pagination control, you'll find a buttons that says "Comma-delimited CSV file". You can download the CSV file, load it into a spreadsheet program, and add notes and images to you heart's content!

You can't save the text or images with the report in TNG.  To reuse them, you'll need to keep track of them outside of TNG (perhaps by saving the completed spreadsheet), and copy-and-paste content (either from a new report into the saved spreadsheet, or the text &image content into the spreadsheet with new data.)

- Robin

Share this post


Link to post
Share on other sites
Leo te Braake

Hi Robin,

You describe a very easy,  perfectly working solution.  For a one-time report.

But I hoped to getsomething in the spirit of TNG: a report once defined, adapting itself to changing conrent of the query on which the report is based.

 

Leo

Share this post


Link to post
Share on other sites
Robin Richmond

This thread  prompted me to look at a mod that I had not updated for TNGv13.  It already did part of what I think you want, and I tweaked it to provide for report footers. Adding the footer was surprising simple once I realized that I could simply use an HTML element in the description. You can download it from the Report Rows And Footer wiki article .

The important features of the mod are that

  1. Like many of my mods, it provides a "Results per page" option that lets you change the size of the report without going to Admin>>Setup and changing the system-wide results per page option.  Thus, you can easily print the entire report.
  2. In the Report Description field, a block HTML element with id='thisReportFooter' will be displayed as a footer instead.

The mod also can increase the number of results per page by printing two tables side-by-side.  Of course, that feature only works effectively if the report is relatively narrow. 

The Wiki article isn't fully updated, and I plan to modify the mod to add a message to the Report editor describing the footer capability.  But that may take a while because of other priorities.

Let me know if you encounter any problems.

- Robin

 

Share this post


Link to post
Share on other sites
Leo te Braake

Hi Robin,

It took me half a day, before I found the mail I had seen earlier and that pointed to this message: in the trash bin....

Installing the mod was no problem. But it interfers with your "Admin Reports Floating Editor" mod : in that mod I can no longer remove the SQL Builder pane.

using and editing two lines from W3Schools, I could create a footer-text, with a separate header.  For a footer text, it appears rather high: above the table,  I think it is still part of the Description  :-) . But I guess that I could extend the functionality to linking to an image as well.

Promising!

Leo

Share this post


Link to post
Share on other sites
Robin Richmond

Report Rows And Footers can't interfere with Admin Reports Floating Editor because they do not modify the same programs.
Admin Reports Floating Editor modifies admin_editreport.php and admin_newreport.php, whereas
Report Row And Footer modifies only showreport.php.

Do you have any other mods that affect admin_editreport.pp

Can you give me a screenshot or point me to the report where the intended footer was displayed above the report?  In particular, I'll need to see the exact contents of the report's description field.

I guess that I should add an example to the mod's wiki article, I cant think of a good example, so I'll start with a very crude one
Here's a screen clip from admin_editreport.php, where you see that I used a <footer> element with id='thisReportFooter' to define the footer.  The Wiki article says to use a "block element".  A <footer> element seems apt, but a <div> element would work just as well.

In this screenshot, I exposed just enough of the SQL code to reveal how I turned the field p.place into a hyperlink to placesearch.php.  That's not critical to this example, buyt as long a I happened to pick this report, I thought that I'd mention it.
image.png

=================================================================================
And a screen clip from showreport.php, where I've underlined the header and the footer. You'll see that I cut off a bit of the footer in the screen clip.
image.png

===========================================================================
And here is the report in Format-for-Printing mode, which eliminates some of the noise.  I'm not happy with the whitespace above the footer, but I don't know if I can do anything about it.  It also appears that the footer has smaller text than the description.  Again, I probably can't do anything about that. The solution will probably be for users to add ""style='font-size:110%';" to the <footer> tag in the description field.

image.png

 

 

Share this post


Link to post
Share on other sites
Leo te Braake

Hi Robin,

Here is the SQL for the report of which I sent you a print-to-pdf by mail:

SELECT
	CASE
		when SN is null and PN is null then "Totaal"
		when PN is null then SN
		else " "
 	END                       as Naamvariant
	,CPN                      as telling
	,IF (PN=" " , " ( - )", PN)  as tussenv
from
	( Select
		lnprefix as PN
		, count(*) as CPN
		, lastname as SN from tng_people
	where gedcom="tree1"
/*		and (lnprefix like "%" 
		  or lnprefix = "")     */
		and  lastname LIKE "Bra%k%"
	group by SN, PN with rollup )
 as SNPN order by SN, PN;

/* this report is SORTed by   lastname , lnprefix */

 

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×