473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

problem in printing

archulu
34
hi i am archulu . i am doing a project in perl. in my project i want to print 10 questions per page. now my problem is i want to insert "previous" and "next" buttons are add in front and last of dipalying my page.
how we print these words pz give me some sample code for that

Expand|Select|Wrap|Line Numbers
  1. my $entriesperpage = 5;
  2. my $start = 1 ;
  3. my $end = 10;
  4.  
  5. my %globalhash ;
  6. my @data = <FH>;
  7.  
  8.  
  9. foreach my $s (sort {$a <=> $b} keys %$global ) {
  10.     my $from = ($pageno * $entriesperpage) - $entriesperpage + 1;     
  11.     my $to = ($pageno * $entriesperpage) ;
  12.     if ($s >= $from && $s <= $to) {
  13.         my $arrayref = $global->{$s};
  14.         my $a = $s;
  15.         my $total_entries = keys(%$global);
  16.         $noofpages = $total_entries / $entriesperpage;
  17.         for (my $i = 1; $i <= $noofpages; $i++) {
  18.             href=\"javascript:showpage('../Anchor/News_Onlinetest?session=$session_id&pageno=$i&user=$user1&htno=$htno&DateofExam=$da&timeofexam=$time&examid=$ei')\"> $i </ a > &nbsp;";
  19.  
  20.             if ($i > 1) {
  21.                 print "<a href=\"javascript:showpage('../Anchor/News_Onlinetest?session=$session_id&pageno=$i&user=$user1&htno=$htno&DateofExam=$da&timeofexam=$time&examid=$ei')\"> </ a > &nbsp;";
  22.                 print $total_entries - 10;
  23.                 # print "&remaining=";
  24.                 # print $total_entries;
  25.                 # print "&pagenumber=";
  26.                 print $i - 1," | ";
  27.                 print "\'>\n";
  28.                 print "NEXT" ,"</a>"," | ";
  29.             }
  30.  
  31.             if ($i > 0 && $i <= $noofpages -1) {
  32.                 print "<a href=\"javascript:showpage('../Anchor/News_Onlinetest?session=$session_id&pageno=$i&user=$user1&htno=$htno&DateofExam=$da&timeofexam=$time&examid=$ei')\"> </ a > &nbsp;";
  33.                 # print " | <a href=\'issue_view?itemtype=$item_name&session=$session_id&limit=";
  34.                 print ($entries_per_page * $i);
  35.                 # print "&remaining=";
  36.  
  37.                 if ($i == $i -1) {
  38.                     print ($i * $entries_per_page + $end);
  39.                 } else {
  40.                     print (($i + 1) * $entries_per_page);
  41.                 }
  42.                 # print "issue_view?itemtype=$item_name&session=$session_id&pagenumber=";
  43.                 print $i + 1;
  44.                 #print "\'>\n";
  45.                 print "PREVIOUS" ,"</a>";
  46.             }
  47.  

this code was given the result, but not in correct maner.

plz help to me
any modifications in my program plz plz help to me
Jun 12 '07 #1
2 1129
KevinADC
4,059 Expert 2GB
what is %$global?

foreach my $s (sort {$a <=> $b} keys %$global ) {

what does it have to do with your paging?
Jun 12 '07 #2
Hi ,

Try using HTML::Pager.
http://search.cpan.org/~samtregar/HTML-Pager-0.03/Pager.pm
Jun 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael J Whitmore | last post by:
I am getting tired of losing hair over this. Here is a function that simply inserts one of three images into a document right before printing. It is called for every element that has a specific...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
1
by: DCraig | last post by:
I'm having problems printing to a line printer from both Crystal Reports and SQL Server reporting services using dotnet. When I try and print a report from an application with Crystal I get the...
5
by: C-Services Holland b.v. | last post by:
Hi all, I've run into a problem trying to print from vb.net (2002) in Windows 98. To test it I've setup a single form with a button and the following code: 'the form has a button called...
4
by: Sukh | last post by:
Hi, I am tring to change the paper size from default to custom paper size. In print preview its showing my custom size but when I print it print on default paper size. Can any one help me to...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
0
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
0
by: gnewsgroup | last post by:
In my asp.net 2.0 web application. I create chart images on the fly by getting the data from the database. These chart images all have fixed width, but the height is dynamic depending on the...
5
by: NoOneCanHelpMe | last post by:
Hello everyone, could someone help me please, I want to print out the frequency of each vowel in the string and I think I will need to use the hash table I already have but im not sure how to do it...
6
by: babaidebnath | last post by:
Hello all, I am presently having a problem with printing in C#. The problem is my customer provided me a pre printed paper and I need to print value into some specific positions. But problem is C#...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.