Gossamer Forum
Home : Products : DBMan : Customization :

Need to display all records on one page...

Quote Reply
Need to display all records on one page...
I need to display all the records on one page in a particular format. I am using the Short/Long mod. First I want to display all the records using the short display, this is easy. Then I want to display ALL the records, one after another, in the long format as well.

This is to create one document that can be printed and stored. Once I records have been posted in short format, how can I access them again and display each in the long format? Are they already in a hash or something that I can access and just print out using a loop?

Any ideas/suggestions are appreciated!

Quote Reply
Re: Need to display all records on one page... In reply to
So you want the records displayed in the short form and then you want a link on that page which will display all the records in the long form. Right?

The best way to do this would be to do the search over again, with a different display.

You can make your link using the $ENV{'QUERY_STRING'} environment variable, $db_script_url and a flag so that the results would be displayed in the long format. Something like

<a href="$db_script_url?$ENV{'QUERY_STRING'}&show_long=1>See full records</a>

Then it would just be a matter of plugging the $in{'show_long'} flag into sub html_view_success to determine which display subroutine to use.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Need to display all records on one page... In reply to
I must not have made myself clear, I actually want the short form AND the long form all on ONE big page. Arent the records already in some accessible form having just been printed in the short form?

Quote Reply
Re: Need to display all records on one page... In reply to
Oh. Maybe I misunderstood what you wrote.

That should be pretty easy.

In sub html_view_success, there is the structure:

Code:
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}
(This is from the default html.pl file.)

All you need to do is have that structure twice, using a different display subroutine for each one.


JPD
http://www.jpdeni.com/dbman/