Not sure if this helps you in relation to printing the report I am assuming
you want the report/data bit not the controls like buttons etc to appear in
the printed report?

depending on how you page/report is setup you could create a image of the
control that is holding the datagrids or whatever you have your data layed
out in using the
WritableBitmap, this will just make a image of that control e.g. datagrid,
usercontrol or whatever you pass in to make the bitmap

then you pass that to the PageVisual to print, this way you can have a bunch
of things on the screen and select specific parts/layers whatever/however
you page is setup to print

e.g. you set your page/usercontrol up in layers using <Grid>

<Grid>
   <Grid x:Name="PrintMe">
      datagrids and report data to print in this layer/grid
   </Grid>
   <Grid x:Name="UserPressMe">
       buttons and things in this layer/grid
   </Grid>
<Grid>

then you make a bitmap using WriteableBitmap of the "PrintMe" grid

I am also not sure if you are just getting a printed page with the report in
the incorrect Portirat view, but if you are not already, you can atleast get
the print dialog window to show and select the Landscape view then hit the
print button

On Fri, Jun 18, 2010 at 4:45 PM, <[email protected]> wrote:

> Thanks for the suggestion. Our pages consist of a number of controls, so
> one of the things we were
> considering was to add the controls to a separate usercontrol and then set
> the PageVisual to that.
>
> Unfortunately, I'm not allowed to add a child of one control to another
> control's children collection
> without removing it from the first one - I already tried that. But I can
> set the PageVisual to the
> controls within the page without needed to disconnect them.
>
> Looks like there's a fair bit of work involved here. I was hoping to not
> have to re-execute all the
> underlying queries just to repopulate the pages for printing. This will
> possibly require all the
> infrastructure code that makes up normal page creation!
>
> Anyhow, I will be looking at the transform that Dan Lazner sent and
> probably come up with some
> sort of compromise.
>
> Regards,
> Tony
>
>
> On Fri, Jun 18th, 2010 at 4:06 PM, Jordan Knight <[email protected]> wrote:
>
> > Hey Tony,
> >
> > Maybe consider having a view especially for printing... use the same
> > ViewModel or what ever you have and load up the new view before
> > printing
> > from that...
> >
> > In my experience, it's always better to have Print views (like media
> > type in
> > css etc)...
> >
> > JK
> >
> > On Fri, Jun 18, 2010 at 2:48 PM, <[email protected]> wrote:
> >
> > > Hi all,
> > >
> > > We have finally made the move to Silverlight 4.  It was a hard
> > slog, mainly
> > > due to third party
> > > control library issues, and we still have some styling issues,
> > however
> > > we've made it.
> > >
> > > One of the key reasons that we made the move to Silverlight 4 was
> > for its
> > > print functionality.
> > >
> > > So anyway, we have been setting up a few pages for printing. But we
> > are
> > > hitting a stumbling block
> > > or two.
> > >
> > > Most screens are landscape, whilst most printers are set up for
> > portrait
> > > printing. I have a report
> > > showing on a screen that needs to be printed landscape. When I set
> > the
> > > PageVisual object to my
> > > page, and call print, it wants to print out the page using
> > portrait
> > > orientation. I have not found a way
> > > to get it to change/default to landscape. Is there a way to do
> > this?
> > >
> > > Regards,
> > > Tony
> > > _______________________________________________
> > > ozsilverlight mailing list
> > > [email protected]
> > > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
> > >
> >
>
>
>
> _______________________________________________
> ozsilverlight mailing list
> [email protected]
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to