Limit what is printed on a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    Limit what is printed on a report

    can anybody explain how to use this syntax so i can print a report based on customers id and not all the reports

    object.printrep ort (showdialog,ran ge,pagefrom,pag eto)

    thanks,
    lee123
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Can you give us some idea of what version of VB you're using? What type of object object is? Where the data is coming from, that you want to filter?

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      I guess you are using vb6.
      Generate the report by filtering the records as per customer id and then use printreport method of the DataReport to print the report.

      Comment

      • lee123
        Contributor
        • Feb 2007
        • 556

        #4
        Hey killer42,

        im using vb6, and i guess the object is the Datareport it's just the syntax i don't understand the range part is this for how you want to filter your report to what you want to report to show and what is the dialog part of this function. is there a web site that explains this because i search and they didn't have what i was looking for.

        lee123

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          just use

          report1.printre port (showdialog,ran ge,pagefrom,pag eto)

          showdialog- if print dialog is displaued or not
          range --default is all
          if specify range mention pagefrom (starting page of range) and pageto(last page of range ) to print

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            lee123, if you look in the documentation, you'll see that the range argument on the PrintReport method simply allows you to specify whether you want to print all pages, or only those specified by the subsequent arguments. These relate only to the page number, not the contents. The ShowDialog argument won't help you, either. Based on what the doco says, it just shows the standard print dialogue box to allow the user to select which pages to print (and choose the printer, I suppose).

            So the answer to your original question, about how to use PrintReport to limit which records are printed, is that you can't.

            I believe that, as debasisdas said, you need to do the filtering before you hit the PrintReport method.

            Comment

            • lee123
              Contributor
              • Feb 2007
              • 556

              #7
              Yea Thanks,

              I thought you couldn't but thanks for the help anyway.

              Question,

              When i put the code in for the Page from - Page To it will stay like that.
              what i mean is if the report has three pages it will only print those three pages all the time? and when i scroll through the page reports it will print the report im on with the three pages.

              example:

              let say i wanted to print pages 5,6,7 i scroll to 5,6,7 then press print it will print these reports or will it start from the begining.

              Thanks,
              lee123

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Well as far as I know, you need to plug in the numbers for the pages you want. That's what the from and to parameters are for. The range parameter says whether to print all, or the ones specified in those other two. So from the sound of it, you would need to determine which pages you want, and feed those numbers into the PrintReport method.

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Originally posted by lee123
                  ............... ............... ........
                  let say i wanted to print pages 5,6,7 i scroll to 5,6,7 then press print it will print these reports or will it start from the begining.
                  that part is handled by showdialog.
                  i fyou want to print page 5,6, 7and then from 10 upto15 ,you can specify that in the print dialogbox
                  specify like

                  5,6,7,10-15

                  Comment

                  • lee123
                    Contributor
                    • Feb 2007
                    • 556

                    #10
                    Thanks for the help. you two

                    lee123

                    Comment

                    Working...