Multiple Page Print using e.HasMorePages [VB 2010 Express]

What I want to do is to print all data from DataGridView1, when it reach the bottom of the page (i use variable panjang to compare), it will generate new page and then continue print the page from the DataGridView1 iteration.
From My Code, it generates unlimited pages(loading pages forever), when I cancel it, all the page is same (print from the first row until the vairable panjang end it)
Dim p As Pen
p = New Pen(Brushes.Black, 2.5)
For i As Integer = 0 To DataGridView1.RowCount - 1 Step 1
For ic As Integer = 0 To DataGridView1.ColumnCount - 1 Step 1
e.Graphics.FillRectangle(Brushes.DarkGray, New Rectangle(lebar, panjang, DataGridView1.Columns(ic).Width, DataGridView1.Rows(i).Height))
e.Graphics.DrawRectangle(p, New Rectangle(lebar, panjang, DataGridView1.Columns(ic).Width, DataGridView1.Rows(i).Height))
hasil = DataGridView1.Rows(i).Cells(ic).FormattedValue.ToString
e.Graphics.DrawString(hasil, font2, Brushes.Black, lebar + 0.12, panjang + 0.12)
lebar = lebar + DataGridView1.Columns(ic).Width
Next ic
panjang = panjang + 20
lebar = 20
If (panjang = 800) Then
e.HasMorePages = True
panjang = 40
lebar = 20
Exit Sub
End If
Next i
e.HasMorePages = False
Please help me, thanks...

But
For I As Integer = 0 to DataGridview1.RowCount - 1
is the iteration of DataGridView1's data
if i use 
For I As Integer = panjang To DataGridView1.RowCount -1
The result could not retrieve all the data from DataGridView1
panjang is use for indicator for if it reach some number, generates new pages

Similar Messages

  • Light room 5.0 multiple pages printing issue

    I'm facing strange issue with multiple pages print from Light Room to Pixma Pro-10 using Canon IJ XPS driver. (OS Win 7)
    Every time when I want to print multiple pages, second and all others are shifted to green. It's also seen on Preview page - see below
    View: original size
    It's a print of two exactly same images (created by virtual copy in Lr) only difference is a printing order (seen on bottom left) if I swap  the printing order results is the same - second print is shifted.
    Even if I make 8 copies of the same image and print it - 4 per page (2x2 pattern) all images on the first page is ok and all on second page are shifted.
    I can'not imagine where should be a problem. Image is in sRGB color space. Color management managed by printer. Printing from other applications (tested with Irfan and ACDSee) seems to be OK.
    It's not a startup problem - I already print numerous images without issue - its should be faulty settings somewhere - but I'm not aware of any color related settings change.
    Disabling preview didn't help - second and next images are shifted
    Color management in LightRoom is set to Managed by printer - which gives excellent results (for the first image)
    Any other settings produces much worse images.

    Some thoughts that may or may not be of any help:
    1) To me the "green" image looks desaturated like a ProPhotoRGB image that is being printed with an sRGB profile.  All images in LR have internal color numbers that have ProPhotoRGB-sized colorspace but a different gamma, irrespective of what the source image had for its colorspace, so the way you have things set, I would assume that LR is sending raw ProPhotoRGB-like data and the printer is doing a conversion, but erroneously only for the first page, somehow, whereas any other program that prints is sending sRGB data and it works every time.
    2) What color management settings do you have set on the printer?  Are they some sort of Automatic color or have you set a specific color profile to match the paper?
    3)  What happens if you have LR manage the color with a paper-specific profile set in LR and set the printer not to manage color?  Does the first page print differently, then?  Create smallish-sized prints on each page so as not to waste ink.  This is the way I'd have LR and the printer setup, with LR doing the color-management and the printer not.  You haven't said how you have your printer settings, so something that could be happening is LR is expecting the printer to do the color-management and the printer is expecting LR to be doing it, so its not working right.
    4)  A first page printing differently than the others can be a setting in the printer, to handle a cover-page differently than the rest, because it has different paper.  I have no experience with your printer, but you might look to see if there is such a setting.
    5)  You haven’t said if you’re using any LR printing layout preset or not.  If so then try printing without having selected one or select a completely different, standard one, and see if the problem clears up.
    6)  LR will remember the last printer and printer-driver settings that you used, so if the driver is updated but LR is remembering settings for the previous driver, then things can get messed up.  You can try uninstalling and reinstalling the printer drive.  You can try installing another copy of the printer driver using a different name for the printer, that way LR’s saved settings shouldn’t be associated with that new name.
    7)  As a last resort, and only after reviewing various preferences you have set in LR, you can try to reset LR’s preferences, in case something is corrupted and causing problems.  The way to reset the preferences is to exit LR and rename the preferences file to something without an .agprefs extension, then restart LR.  If renaming doesn’t seem to be working, then move the .agprefs file to your desktop, temporarily.  You can delete the preferences file, but it’s safer to rename it or move it, in case it doesn’t fix the problem, then you can rename or move it back and have all your old preferences back, instead of recreating all the non-default settings.  The Preferences file location along with many other things, is documented here:
    http://members.lightroomqueen.com/Knowledgebase/Article/View/1373/205/lightroom-5-default- locations
    Finally, is there a reason you’re using LR 5.0 rather than one of the newer versions, in case 5.0 has a bug that has been fixed in subsequent versions?
    Various LR versions can be follow by clicking on the Windows/Mac link under Lightroom down near the bottom of the center column of the Adobe Updates page: http://www.adobe.com/downloads/updates

  • Printing Problem - Incomplete multiple page print job - until paper runs out

    I'm on Mac OS 10.9.3 printing to a Samsung CLX-6250FX. This is a network printer used by all the Apple/Window computers in this office.
    I am having terrible problems recently with printing multiple page documents - excel, word, email, pdf etc. I am spending a fortune in paper and printer cartridges.
    The print job does not complete and the last page printed, the following message prints:
    ERROR: syntaxerror
    OFFENDING COMMAND: true        cvt      Tfpgm     nglyf      '   ^  head
    STACK:
    -mark-
    /sfnts
    Then the same printer job restarts and fails at the same point until the printer tray runs out of paper (unless the print job is aborted and/or the printer is turned off and turned on again)!!
    The specific error message displayed by the printer software is either "Remote host did not accept data file (32)" or "Remote host did not accept data file (105)".
    I haven't seen any pattern whatsoever in terms of application used.
    I have deleted the printer and reloaded the driver from the disk supplied with the printer. I have checked to see that I am running the most recent driver.
    I've already reset the printing system, but that didn't fix it.
    I have seen this problem on various support communities pages, but for different printers.
    I have yet to see a solution - Any other recommendations please?

    The error message you see printed is a Postscript error. With your printer, postscript (normal output type from applications) is converted to the printer's page description language before being sent to the printer. So, I believe the problem is in some part of the driver software.
    For first step, I would try restarting from the Recovery partition and repair the hard drive using Disk Utility. You can repair permission, too. This is trying to correct a corrupted file.
    http://support.apple.com/kb/ht4718
    (just read the first paragraph)
    If that doesn't fix it, I would try downloading and installing the latest driver for the printer.
    Come back for more if that still doesn't work.

  • Multiple page printing!!! help needed

    hi,
    Another problem to solve. How the hell I can print multiple pages. If my frame is too large I want it to print on multiple pages. I tried different things but doesn't work. Please help me out in this too. I have included a small code currently it is prinitng one page only. But I need to print multiple pages if the display is too large to fit on one page.
    sample code that I am using
    PrinterJob printerJob = PrinterJob.getPrinterJob();
              //Calls painter to render the pages. The pages in the document to
              //be printed by this PrinterJob are rendered by the Printable object,
              //painter. The PageFormat for each page is the default page format.
              printerJob.setPrintable(this);
              //Presents a dialog to the user for changing the properties of the print job.
              if ( printerJob.printDialog() )
                   try
                        //this print() method implements the Printable interface
                        printerJob.print();
                   catch (Exception e)
                        e.printStackTrace();
    public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException
         if (pageIndex >= 1)
              return Printable.NO_SUCH_PAGE;
         Graphics2D graphics2 = (Graphics2D) graphics;
         graphics2.translate(pageFormat.getImageableX(),
         pageFormat.getImageableY());
         //prints the selected frame only
         selectedFrame.paint(graphics2);
         return Printable.PAGE_EXISTS;
    }

    I used to ask similar question when I starting using Java printing APIs. Is is useless to ask such general questions.
    There is no magic pill. There is no way your program knows how many pages to send to printer - you need to tell your program everything about it. Spend some time and do some research, you will figure out by yourself. Good luck.

  • Turn off multiple page print - Adobe 11.0.4

    Hi:
    After printing multiple pages on one sheet of paper I am not able to find how to revert back to printing a single page on one sheet other than entering 1 by 1 next to custom. Any suggestions?

    Hi Dave,
    OK I’ve downloaded your  file and installed. The option Remove Security appears under the Encrypt action only if I have a file open and it will indeed remove the pw from that file and allow me to save back to the same file name. However I don’t see an option to add multiple files to the action, and if no file is open, the action is dimmed out. This is my last hurdle to getting this job done; can you point me in the right direction?
    Gail

  • Problem in multiple page printed (SAP Script )

    Hi Experts ,
    In SAP Script print ,
    First page print is perfect on preprinted stationary ,but
    Second page data is getting printed 2-3 cm up.
    Please tell me various reason for this ...
    Thanks
    Sonal

    Hi Sonal ,
    This happens with your predefined stationary .
    Are you declaring it in the same window where your declaring your data ?
    If yes, Try taking another variable window and keep all your predefined sationary there and then call it evry time you call your window with data .
    Or, It can be with the Text element try giving 2 empty lines before the text element it solves your problem!
    Hope it helps!
    Much Regards,
    Amuktha .
    Edited by: Amuktha Naraparaju on Feb 9, 2009 9:57 AM

  • Multiple page print dialogue / warning

    Good day!
    I'm working on a 50-page form in which the user only needs to print a few pages at a time.  Numerous times we forget to select which pages in the print dialogue and end up sprinting to the printer and mashing the cancel button.  Possible solutions:
    When user clicks the Print button on the form, a dialogue appears asking which pages user wants to print.
    When user does not select specific pages to print, a warning appears asking, "Are you SURE you want to waste a ream of paper?"
    In the form's table of contents (on the first page) have check boxes next to each page name, so user can select the pages that will print.
    I am a cut and paste Javascripter at this point.  Thanks for reading and for any help you are able to provide.
    Cheers~!
    Software:  Adobe Acrobat XI Pro

    But
    For I As Integer = 0 to DataGridview1.RowCount - 1
    is the iteration of DataGridView1's data
    if i use 
    For I As Integer = panjang To DataGridView1.RowCount -1
    The result could not retrieve all the data from DataGridView1
    panjang is use for indicator for if it reach some number, generates new pages

  • How can i create multiple page report using excel report generation toolkit from excel template?

    i am having code which create report in excel.but it prints only single page. if content is more than size of template than insted of tacking new page it prints only single page.Please help me out.
    Anyone has material for learning activeX in labview? Please mail me on [email protected] 
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

    Hi thanks for reply.....
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

  • How to put report title and page no to appear in multiple pages,when using cross tab reports

    Post Author: shaminranaweera
    CA Forum: General
    I am using crystal reports 9.0 with odbc foxpro database conectivity
    I have designed a cross tab report and it is on the report header part and all the report details  are fine,except that the report title and  and page no's only show on the first page of my report.Pls tell me how can i put my report title and page no on all the pages in my crosstab.

    Post Author: foghat
    CA Forum: General
    You need to put your title in the page header if you want it to appear on every page.  The report header only displays once per report.

  • Multiple Page print

    Dear Experts,
                       I am all the Data's Move  Smartforms in One  Internel Table. Name is IT_EKPO1.(Available in SF) In my Itab is one PO NO->Different Material> Same Address.
    reference: for eg:
    PONO            MATNR     ADDRES         QTY
    10                   lofg           cccc                5
    10                   lidf            cccc                10
    20                   jid              ttttt                 3
    40                   jfdi             dddd                6  This Format.
    My Requirement is Each PONO Should be print SEPARATE PAGE. That is
    10----
    >I page
    20----
    >2 page
    40----
    >3 page.
    Form Design is  THIS WAY PRINT
    PO NO :10  --->secondary window1
    Adress : cccc---> secondary window2
    details: (TABLE FORMAT)---->main window.
    sno    matnr           qty
    1        lofg               5
    2        lidf                10
    when PONO 20 ABOVE FORMAT Print Second page.AND get the Details of PONO 20.
    ASP.
    warm Regards,
    raj.

    place the cursor on main window of the 1st page...
    right click ->create>flowlogic-->command.
    in that command ...
    check the checkbox goto next page and give the page that u want and in the condition tab specify the condition that u want to trigger the next po...

  • Smartforms Multiple Page Printing

    Hi Guys,
    I know this could be regular posting from others but it seems that i can't any solutions around.
    The Problem is about printing multiple copies from Billing Document at a time. What user requested was to have the word "Original" in the first copy and the subsequent copies will have the word "COPY". i know that this can be done in SAPScript by modifying the print program but how about Smartforms???
    I tried NAST (IS_NAST) table as passed by smartform but the field ANZAL seemed to return '2' when i need 2 copies. How do i know when is printing the first copy and when is printing the subsequent copies? any status from any tables indicating i am printing the first or the subsequent copies? Tried NACH but it didn't help much neither....
    Please help!!!!!! Thanks a lot....
    Cheers,
    Andrew

    Ok,
    so  transaction SMARTFORMS
    set the name, press CHANGE
    Select Form Interface (in the tree)
    You are in the Import parameter, you have to create one import parameter. Choose a name for example WV_TYPE, with assignment TYPE and reference CHAR1.
    After this just generate the function module.
    And now, when you will show the new function module you have the WV_TYPE parameter that is present.
    So, in the Text_Element or anything else you just have to set in the Conditions the test  WV_TYPE = 'X'   to display this Text_Element
    I hope it's clear (sorry for my english)
    Frederic

  • JSP Session Timeout in multiple pages (iframes used)

    Hi,
    Here is my scenario. I have a JSP Page i.e. A.jsp in which I am setting a session timeout to 3 minutes. I also have another JSP included i.e. B.jsp in the same page (A.jsp) using the following code i.e.
    <IFRAME SRC="B.jsp" width="100%" height="800" frameborder="0" align="center">
             <!-- Alternate content for non-supporting browsers -->
    </IFRAME>I am also setting a session timeout to 1 minute in the B.jsp. Now if the session timeout in one of the pages i.e. A.jsp or B.jsp I want to route to a different page i.e. C.jsp.
    Now my problem is if the session timeouts in the B.jsp the C.jsp is shown inplace of the B.jsp page inside A.jsp. Means A.jsp still shows it's content at top and under it C.jsp is shown. I want to route to C.JSP page if a session timeouts in A.jsp or B.jsp and only show C.jsp.
    Any help is appreciated.
    Thanks

    Where exactly I put the javascript. Here is currently I am checking for the session timeout:
    String error = (String) request.getAttribute("Error");
        if (error != null)
            out.write("<center><strong>");
            out.write("<font color=\"Red\">");
            out.write(error);
            out.write("</font>");
            out.write("</strong></center>");
        response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
        response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
        response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
        response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility
        String userName = (String) session.getAttribute("User");
        if (null == userName)
            request.setAttribute("Error", "Session has ended. Please login.");
            RequestDispatcher rd = request.getRequestDispatcher("C.jsp");
            rd.forward(request, response);
    ................The same code is in A.jsp and B.jsp. If I want to use the javascript to check if it's the top frame or not and redirect properly where exactly I need to put that code.
    Thanks

  • Change default view across multiple page libraries using the same content type/types?

    I am the editor for a large SharePoint publishing site with approximately 130+ subsites. Based on our content, I've create two diffferent default views that will come in handy as we move to a distributed authorship model. (I'm thinking specifically about
    the Quick Edit/Excel-like feature to make quick changes to page/document metadata.) 
    The authors/content owner/editors have NO experience with SharePoint, so while the benefit of using views is that they can be tailored to individual needs, I'd like to start them off with something that is VERY easy to change on the fly. It's either that
    or, as just a power user in the CMS, go to each individual page and document library and change it manually, which could take days, if not longer. Thanks!
    Ryan D Watters

    Essentially, yes.
    That said, I am using SharePoint 2013, and I just now realized that I posted this in the legacy SP forum. You'll have to excuse me -- this is my first time posting:)
    Basically, I have two different "ideal" views based on two different site templates. These two site templates account for over 100 publishing subsites. The view has 18 different metadata that will make editing/making changes to article pages much
    easier for content owners because they will be able to go into the page libary>ribbon>library>quick edit and edit the metadata as if it were an Excel spreadsheet. This comes in especially handy for things like rollup order between primary, secondary,
    tertiary pages within a subsite.  Ideally, it would be nice to be able to add that view as an option within the CMS (similar to the way you can add a view style).
    I hope that makes sense. Also, I'll repost the question to SharePoint 2013. Much appreciated!
    Ryan D Watters

  • I can't print Multiple pages in FF6 – clipping off content after page 1. I have thrown out firefox completely off my imac and re-installed... still does not print correctly. How do I fix this?

    After upgrading last week, i can no longer print multiple page print outs off of any website, without the secondary pages clipping off content. Page 1 prints fine... the remaining pages do not.
    pages print fine in both safari and chrome...

    If you are wondering why you are not getting any responses, it is because you have vented a complaint without any details that make any sense or give anyone something to work on.
    If you want help, I suggest actually detailing what has happened, with versions of software etc. Anything that would let us assist.
    As a start I am guessing that you have not really got the hang of "How it all works". Firstly download the Pages09_UserGuide.pdf from under the Help menu. Read that and view the Video Tutorials in the same place. A good addition would be the iWork 09 Missing manual book and something to help you learn how to use your Mac.
    If there are specific tasks you need help with:
    http://www.freeforum101.com/iworktipsntrick/index.php?mforum=iworktipsntrick
    Is a good resource.
    Peter

  • Any way to get more than 100% zoom on print jobs when printing multiple pages?

    I know how to increase the size of a print job, when I am printing one page at a time. But when I go to print 2 pages at once (the multiple page print function), there are always large margins around the page. I'm ok with saving paper and printing up two pages, but it seems silly to see small print and wide blank margins. Is there any way to increase the print zoom, when printing multiple pages per sheet of paper?

    I once overshot the limit by marking too many photos to fit within 99 pages, but I could never figure out how to fool the application and had to give up trying to add those 14 extra photos.
    I asked a friend (who practically lives in Terminal) if he had any way of modifying that limit, but he reminded me that if their printing services are set up to bind books and bill for only 99 pages, fooling the application might be useless if the service only prints me a 99 page book and discards the additional pages.
    I can understand that you wouldn't want to let people print 1000 page books, but I sent feedback anyway to allow me to increase the limit. Anyone know of any service that lets you print beyond iPhoto's limits?

Maybe you are looking for