Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports
Message
From
30/04/2008 13:05:36
 
 
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:
01314269
Views:
6
>>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

LOL

I've written tons of reports, including ones written directly in PCL, so it's not a hard area for me. The book ducks out on this one, it says "WPF doesn't have anything like this currently, but you can expect third-party vendors..."

I'm toying with the idea of writing a small report generator for this. It looks like it would be pretty easy to do.

One beauty of the above technique is that since it's creating grids if I'm just outputting text and borders, I could easily adapt it to creating unpaginated HTML, Excel or even FlowDocument.

But I also have the ability to insert any UIElement I want into a grid cell, so I could do a report with charts or pictures in the rows too.

I'm still patiently waiting for the downside to rear it's ugly head.
Previous
Reply
Map
View

Click here to load this message in the networking platform