Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports
Message
From
30/04/2008 04:12:03
 
 
To
29/04/2008 14:04:08
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01313631
Message ID:
01314112
Views:
6
>>Anyone written any reports in WPF yet?
>>
>>It's a bit weird, FlowDocuments take block elements like paragraphs and tables. But don't offer much in the way of "real" pagination capabilities and fixed layout.
>>
>>Fixed documents don't use block elements. they use UIElements, so no paragraphs/tables etc. The layout can be pretty fixed but in order to get sizes for layout you have to do:
>>
fixedPage.Measure(sz);
>>fixedPage.Arrange(new Rect(new Point(), sz));
>>fixedPage.UpdateLayout();
>>
every time you wan to get your size information. (I'm worried it may be slow.)
>>
>>After about 50 false starts figuring out various ways to do this. I'm creating a fixed XPS document using grids and textblocks.
>>
>>Was curious if anyone else had tried writing reports in WPF and if they had any luck with it?
>
>It's a bit lonely here in the WPF section. I'm talking to myself again. <g>
>
>Just wanted to update this for anyone in the future trying to write WPF reports . I could not find any good references on how to do it. I did find a lot of references that say it's way to hard and you should not try this at home. But the technique I came up with is working very well so far and does not appear to have a significant downside to it, so I thought I would share.
>
>The basic layout is this:
>
>
>FixedDocument
>  PageContent
>    FixedPage
>      Canvas
>        Grid <- Body Grid
>          Border <- Cell
>            TextBox <-Text
>
>
>I do the update layout calls above after each row is added to the grid and then I check the BodyGrid.ActualHeight to see if it's time for a new page.
>
>When I'm done I have a text based XPS document that I can view or print.
>
>HTH someone in the future.

Hi,
FWIW I read your original post. I even went and re-read the Documents and Printing chapters in the Apress book but in the end had nothing constructive to offer. It wasn't even clear to me whether starting with Fixed or Flow documents would offer the best approach. I'm going to be looking at the printing process down the line but output will not be of the 'report' type - just visual classes.

IAC, any sort of reporting has never been my strong point. I've managed to get away with only writing maybe a dozen simple reports in all my VFP years - and hope to be able to maintain this record with .NET<s>

Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform