Re: is CrystalReportViewer the only way to display Crystal Report file from .NET WinForm?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael (use4forums_at_yahoo.com)
Date: 05/17/04


Date: 16 May 2004 20:53:58 -0700

Hi Brian,

That's exactly what I am thinking. I am not sure how Microsoft Report
Viewer control interacts with CR Report. I would assume that Viewer is
a wrapper calling the CR Engine API to fulfill the functionalities.
One significant example is: the generic CR Parameter Prompt Text
dialog will be shown for the report that requires parameter but no
ParameterValues provided by the UI. The CR Preview panel may be just
another set of CR APIs. These lead me to wonder the possibility of
evoking CR API without using Viewer.

I was thinking of using generic Dialog to collect input and another
generic Form with Viewer for presentation as well. However, the
reports may require different number of parameters (data types), types
of control. Some controls even require data binding and/or associated
business rules. These factors make the "generic" design idea hard to
be justified, if it's not a "mission impossible". The alternative I
can think of is "scale down the design to exclude the ones required
associated business rules". In this case, the CR Parameter Prompting
dialog will serve the same purpose if not for fancy/good-looking
reason. This is what I am looking for at this moment.

Regarding the parameter prompt issue I am having, I apologize for the
confusion. Let me rephrase the issue "I set the custom Prompting Text
in the CR report file. When the WinForm evokes the CR report file
without providing the ParameterValues, a default "Enter Parameter
Values" Dialog is shown asking for user input the parameter values. It
still shows the CR parameter variables prefixed with '@' sign and
asking user inputs the <discrete values>." I am not sure if this
Dialog comes from WinForm or from CR engine. Am I supposed to see the
custom friendly Prompting Text that I set in Report file earlier? I
may have missed the property setting somewhere, any suggestion on this
issue?

By the way, is there a Runtime module for CR V.10? I was told that
was discontinued after v8.5?

Thanks again, Brian.
Michael

"Brian Bischof" <BrianNoSpam@BischofSystems.com> wrote in message news:<u3tLArdOEHA.2740@TK2MSFTNGP11.phx.gbl>...
> Hi Michael,
>
> I think I understand now. You want to display the viewer control, but not
> use a form to do so? If that's true, then you can't do it. It's like trying
> to write a book without paper. The words have to be put on something so you
> can read them. They can't just float in space. The viewer has to be hosted
> within a form to run. However, I don't understand why having a generic form
> with a generic viewer control that is passed a report object would be a
> problem. I guess you are just trying to streamline things by eliminating the
> form?
>
> Re parameters, again I'm a little confused. It's perfectly feasible to
> create a generic dialog box that takes input from the user and sends it to
> the report object. To make the dialog box specific to the individual report
> parameters, you have to loop through the parameter collection and examine
> each parameter's properties to find out what type of paramter it is, its
> name and its prompt message.
>
>
> HTH,
>
> Brian Bischof
> http://www.crystalreportsbook.com/123aspx.asp
>
> A Crystal Reports.NET book for programmers? Its here!
> * Covers ASP.NET and Windows Forms
> * Gives complete code listings in VB.NET and C#
> * Connect to ADO.NET, XML, DataGrids, Blobs
> * Modify parameters during runtime
> * Maps out the complex ReportDocument object model
> * Alerts you to the bugs and how to get around them
> * Shows how to perform runtime customization
>
>
>
>
> "Michael" <use4forums@yahoo.com> wrote in message
> news:8b027d12.0405140919.7025b9a3@posting.google.com...
> > Brian,
> >
> > Thanks for the insight. I've tried those, and they work great.
> > However, most of the reports requires some of interaction with user
> > and pass parameters to the report. Due to resource limitation, the
> > choice is either creating WinForm for the report which required user
> > interaction, or using generic CR parameter dialog. The first choice
> > involves more resources and time which we don't have now. Thus, I am
> > exploring if there is a way to launch the CR without the Form. It's as
> > simple as "why one more hop?". Is this feasible? If it is feasible,
> > can you point me to the right direction or sample as how-to.
> >
> > Of course, there is UI concern of generic CR Parameter dialog box. I
> > am having problem to show the custom Prompting Text in .NET WinForm
> > even though I do set it in CR v10(but that's not this thread topic,
> > but if you have insight on that issue that's great). :-)
> >
> > Thanks for the help,
> > MichaelJ
> >
> >
> >
> > "Brian Bischof" <BrianNoSpam@BischofSystems.com> wrote in message
> news:<ODjgaGROEHA.640@TK2MSFTNGP12.phx.gbl>...
> > > Why are you creating a form for hundreds of reports? Is anyone
> actually
> > > going to be looking at them? Off the top of my head, I can think of
> two
> > > reasons why you are asking this question.
> > >
> > > 1) You want to print reports in a batch mode and you are under the
> > > assumption that the only way to print is by using the viewer. To print
> > > reports in a batch mode, just load each report into a ReportDocument
> object
> > > and call the PrintToPrinter() method. This doesn't require using the
> viewer
> > > at all.
> > >
> > > 2) You think that the viewer can only print a single report (i.e.
> there is
> > > a one-to-one relationship). This is not true. You can have a single
> form
> > > with one viewer control and it can print any report. Just assign the
> report
> > > to the viewer's ReportSource property and it will preview it. To close
> the
> > > report set the ReportSource property to Nothing.
> > >
> > > If this doesn't address your question, then please post a follow up
> > > message to clarify my misunderstanding.
> > >
> > > HTH,
> > >
> > > Brian Bischof
> > > http://www.crystalreportsbook.com/123aspx.asp
> > >
> > > A Crystal Reports.NET book for programmers? Its here!
> > > * Covers ASP.NET and Windows Forms
> > > * Gives complete code listings in VB.NET and C#
> > > * Teaches all phases of report development
> > > * Alerts you to the bugs and how to get around them
> > > * Maps out the complex ReportDocument object model
> > > * Shows how to perform runtime customization
> > > * Demonstrates all options of connecting with ADO.NET
> > >
> > >
> > >
> > > "Michael" <use4forums@yahoo.com> wrote in message
> > > news:8b027d12.0405130603.60bedfb1@posting.google.com...
> > > > Is there a way to display Crystal Report file without depending on
> the
> > > > WinForm with CrystalReportViewer control in it, such as evoke the
> > > > Crystal Report engine directly or something like that?
> > > >
> > > > I am trying to find way to avoid creating Form for each report(out
> of
> > > > a couple of hundreds reports).
> > > >
> > > > What is the best practice of solving this? Has someone done this
> > > > before, and how to?



Relevant Pages

  • Re: Parameters Dialog Box
    ... EnableParameterPrompting property in the viewer object. ... > This should go before you set the report source. ... > Robert Schuldenfrei ... >>> I have a vb.net app using crystal reports. ...
    (microsoft.public.vb.crystal)
  • Re: Parameters Dialog Box
    ... This is not for the viewer, but for the report. ... EnableParameterPrompting property in the viewer object. ... > Robert Schuldenfrei ... >>> I have a vb.net app using crystal reports. ...
    (microsoft.public.vb.crystal)
  • Re: Parameters Dialog Box
    ... Bob, ... The report is what needs the parameter prompting turned off. ... ReportSource in the viewer to myReport ... >> Dedham, MA 02026 ...
    (microsoft.public.vb.crystal)
  • Re: SpecialVarFieldDefinition
    ... Brian Bischof ... >> the report in the viewer, calling ShowLastPage() and then calling ... >> the viewer or see the pages bouncing around, ...
    (microsoft.public.vb.crystal)
  • Landscape orientation Crystal Viewer
    ... I thought I could adjust the viewer properties without any further aid from ... When I send the report to the viewer, using the statements listed below, the ... > place a crystal report viewer on the form, ...
    (microsoft.public.dotnet.languages.csharp)