Where is there a sample of how to put elements together for printing?
I am looking for a code sample showing me how to put the output of a webgrid along with maybe an HTML header and footer to a PDF.
This isn't really possible to implement in WebGrid. You can't use server-side code to print to a client-side machine - the server has no access to the client's resources.
WinGrid is able to do this because the "client" machine (the one that the user is running the application from) and the "server" machine (the one that's actually running the application code) is generally the same machine.
The closest you can come to this with WebGrid is to use server-side code to emit JavaScript that, when evaluated, causes the page to print.
This could be a great feature for future versions of the UltraWebGrid...
the windows grid have a Print method (I think)
The Report.Print() method will print the report on a printer connected to the server. In a web environment, this is generally not what you want.
A better solution for printing WebGrid is to create a "printer friendly" page. WebGrid has a setting to emit printer-friendly HTML, by setting its DisplayLayout.ReadOnly property to ReadOnly.PrintingFriendly. You can then use the browser's Print functionality to print the resulting page, including the "window.print()" JavaScript function.
Alternately, you can generate the report to be sent back down to the client machine, and the user can use the print functionality of their PDF viewer to actually print the report. The limitation here is that you can't automate this printing task.
you are right...
I mean the DocumentExporter...
document.Export(Grid, Report)
Report.Print(printerName)
but I cant make this work...
The excel exporter doesn't have any concept of what a report object is; are you sure you don't mean the DocumentExporter? Since I'm a Windows Forms developer, I'm not sure what methods are available to the UltraWebGridDocumentExporter, but if one of those overloads takes an ISection, then you could create your own section to export the grid to, then populate the rest of the report yourself, i.e.:
Report report = new Report();
ISection section = report.AddSection();
exporter.Export(..., section); //Not sure what the overloads are here
// Add more content to report here
report.Publish(...);
-Matt