Re: SpecialVarFieldDefinition

From: Brian Bischof (Brian_at_NoSpamBischofSystems.com)
Date: 11/17/04


Date: Tue, 16 Nov 2004 23:40:33 -0800

Yes, its best to use another thread. Someone sent me an email a while back
where she did just that. Created a worker process to show a progress bar and
it ran on a seperate thread. She said that it was a little tough to work out
the details, but not too bad.

HTH,

Brian Bischof
www.CrystalReportsBook.com

"Mauro Servienti" <mauroservienti@online.nospam> wrote in message
news:eRwZaVHzEHA.2012@TK2MSFTNGP15.phx.gbl...
> Thanks for the reply Brian.
>
> Brian Bischof wrote:
> > tough question. when i saw it I thought it would be easy to answer.
> > But it appears that you are right that there isn't a way to access
> > this information. Per the ReportDocument object model, you can
> > reference objects prior to the report being generated but not
> > afterwards (i.e. when the data has been read and assimilated). I
> > tried getting around this by using a formula that references the
> > total page count. But no dice. I finally got it to work by opening
> > the report in the viewer, calling ShowLastPage() and then calling
> > GetCurrentPage(). What a hassle! If you don't want the user to see
> > the viewer or see the pages bouncing around, set the Visible property
> > to false and when you are ready to show it to the user call
> > ShowFirstPage() and set the Visible property to True.
>
> I'll try and let you know, just one question I always need to use a
formula
> referencing the special field and I always need to call ShowLastPage() and
> then read the formula value and then ShowFirtstPage() in the viewer
> (betterwith the viewer hidden).
> If this is true, and then seen that CR has no background load features
(read
> another thread), I think that the best way is to do all this dirty job in
an
> another thread so not to lock the app for a long time, I'm thinking to a
> report with lots of pages... I have to wait for the report IsLoaded to be
> true in order to call ShowLastPage() in the viewer.
>
> > HTH,
> >
> > Brian Bischof
> > www.CrystalReportsBook.com
> >
> >
> >
> > "Mauro Servienti" <mauroservienti@online.nospam> wrote in message
> > news:u0lcMxCzEHA.3808@TK2MSFTNGP15.phx.gbl...
> >> hi all,
> >>
> >> I'm trying to retrive the total number of pages, in a NET Windows
> >> Form App, from the report loaded in CR Report Viewer.
> >> I can obtain a reference to the SpecialVarFieldDefinition
> >> representing a "hidden" field in the report, the problem now is how
> >> to retrive the current value of the SpecialVarFieldDefinition
> >> "TotalPageCount".
> >>
> >> private SpecialVarFieldDefinition GetTotalPageCount()
> >> {
> >> FieldObject field = null;
> >> SpecialVarFieldDefinition specialField = null;
> >> foreach( ReportObject obj in
> >> MyReport.ReportDefinition.ReportObjects ) {
> >> if( obj.Kind == ReportObjectKind.FieldObject &&
> >> obj is FieldObject &&
> >> ( obj as FieldObject ).DataSource.Name ==
> >> "TotalPageCount" )
> >> {
> >> field = obj as FieldObject;
> >> break;
> >> }
> >> }
> >>
> >> if( field != null )
> >> {
> >> specialField = field.DataSource as SpecialVarFieldDefinition;
> >> if( specialField != null )
> >> return specialField;
> >> }
> >> return null;
> >> }
> >>
> >>
> >> Thanks in advance
> >> Mauro,
> >> Italy
> >> --
> >> mauro (--at--) topics.it
>
>



Relevant Pages

  • Re: CR.NET 2003 viewer event handlers
    ... > until the report has been displayed. ... >> Brian Bischof ... >>> I tried the Navigate event handler but it fires as soon as the viewer ...
    (microsoft.public.vb.crystal)
  • Re: Detached Dataset
    ... Generated a report from the dataset with the wizard ... Filled the set manually and called the viewer: ... "Brian Bischof" wrote: ...
    (microsoft.public.vb.crystal)
  • 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)