Crystal Reports Printing without Preview and having Parameters how?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • darf

    #1

    Crystal Reports Printing without Preview and having Parameters how?

    Firstly, I'm VERY green on all this Crystal stuff - so please excuse my
    ignorance. I see on other posts that to print a report without using
    the viewer use:

    Dim crReportDocumen t As ReportDocument
    crReportDocumen t = New myCrystalReport ()
    crReportDocumen t.PrintOptions. PrinterName = "\\server\mypri nter"
    crReportDocumen t.PrintToPrinte r(1, True, 1, 1)

    When I display the report using the Viewer I pass it some parameters,
    eg. CrystalReportVi ewer1.Parameter FieldInfo = crParameterFiel ds

    My question is, how to I pass these parameters when printing the report
    without using the viewer? Or, do I still need to use the viewer, hide
    it on the form, and assign the ParameterFieldI nfo to it? Whats the
    normal way of doing this? I hope i make sense!

    Thanks in advance,
    David.

  • Richard Dudley

    #2
    Re: Crystal Reports Printing without Preview and having Parameters how?

    Instead of using the viewer, you can use the ReportDocument object, and pass
    parameters to that. If you'll be building more than 1 report like this, I
    suggest you go to www.crystalreportsbook.com and buy the book. It's the
    best money you'll spend if you have to work with Crystal, and it will answer
    many of the questions you'll have as follow-ups.

    "darf" <davidhage@gmai l.com> wrote in message
    news:1121904321 .103579.307500@ g49g2000cwa.goo glegroups.com.. .[color=blue]
    > Firstly, I'm VERY green on all this Crystal stuff - so please excuse my
    > ignorance. I see on other posts that to print a report without using
    > the viewer use:
    >
    > Dim crReportDocumen t As ReportDocument
    > crReportDocumen t = New myCrystalReport ()
    > crReportDocumen t.PrintOptions. PrinterName = "\\server\mypri nter"
    > crReportDocumen t.PrintToPrinte r(1, True, 1, 1)
    >
    > When I display the report using the Viewer I pass it some parameters,
    > eg. CrystalReportVi ewer1.Parameter FieldInfo = crParameterFiel ds
    >
    > My question is, how to I pass these parameters when printing the report
    > without using the viewer? Or, do I still need to use the viewer, hide
    > it on the form, and assign the ParameterFieldI nfo to it? Whats the
    > normal way of doing this? I hope i make sense!
    >
    > Thanks in advance,
    > David.
    >[/color]


    Comment

    Working...