WPF SSRS report printing - wpf

We have an application built in WPF. For reports we are using the Winforms host to display and preview the report. There is a requirement to batch print the SSRS reports physically to a printer. i.e. On click of a button, it should print all the reports on a printer (default printer associated with the machine). The problem we face is that a print dialog appears when we try to print the report. We do not want the print dialog, just direct printing of SSRS report to the pinter.
How can this be accomplished?

First of all, sorry about my english.
Steps:
1. you can generate the SSRS report using C# (for example)
2. Instead of displaying a report on the screen, you can export it to PDF (in a temporary folder.)
3. Print this PDF File using a PrintDialog control (Allow you to disable the print dialog).
Probably you can disable the print dialog on the report viewer too but i don't know how.
hope it

Related

Aligning subreports in SSRS

I have a report that looks nicely aligned in the Visual Studio design screen, but when I check it in the preview screen or deployed on the report server, there are large gaps between each subreport and text box.
Is there any way to ensure that these are aligned in the actual report? Particularly in PDF form, which this will ultimately end up as.

WPF Printing in XPS Document Writer

I've implemented a printing feature to print some of the Financial charts in my WPF application by using PrintVisual method. Since the user is free to change his/her window size and/or screen resolution I've use a LayoutTransform, Measure and Arrange methods to make sure that the printed charts gets spread across the entire page evenly irrespective of the size of the application window. All works absolutely well when the user prints on an actual printer or selects PDF Print Driver to print. Layout transform takes effect behind the scene and that shows up in the print, but the user doesn't experience any flicker or change in display on his screen.
The problem comes when the user selects XPS Document Writer. When user does that, the layout on the screen also changes. When the "Save As" dialog box comes up the screen layout changes based on the LayoutTransform provided, which makes the charts go smaller or bigger. The moment user saves the XPS file OR hit cancel on the Save as dialog box the layout goes back to normal. But the strange part is, this happens only when we select XPS Document Writer.
But, user doesn't want to see this.. What can I do to prevent this to happen in the case of XPS Document Writer?
Please suggest. Thanks
perhaps you can make a clone of your canvas or visual prior to applying your transform. clone is not built-in to wpf UIElements but you can use XamlWriter.Save() and XamlReader.Load to clone via XmlReader. google "wpf clone UIElement" or I can post some code if you feel that's the way to go.

Microsoft Report Viewer Control not displaying report

I have built a simple report and run it successfully in test winform apps but when I try to run the same report in my production winforms application, the report just doesn't show up in the viewer. I look at the ReportViewer control after InitializeComponent and everything looks fine.
Are there debugging techniques or gotcha's that might be able to point me to why the report is not showing. It feels like there should be an error of some sort but it just displays a blank form.
This was a simple mistake.
In implementing the report viewer in a MVP environment, I managed to not notice/implement the RefreshReport in the Form Load. Once I called Refresh Report, the report showed up.

How to display the report icon in Firefox for the SQL Server Reporting Services Report Viewer control

It seems that due to ActiveX that Firefox can't display the print icon/button on the Report Viewer control in SQL Server Reporting services. Has anybody figured out a way to work around this or gotten this to work?
If it's not possible, does anybody know of a way to add a standard button that would trigger the print behavior on the report viewer control?
As you state, the print functionality is ActiveX, so it will not work in Firefox.
You could place a button in the "msrs-buttonHeaderBackground" div using a javascript button.
I found the div using the firebug firefox extension - it's great.
You could possibly find the other divs you'd like to hide and put them in a print style sheet, so they don't show up when going to print.
http://www.456bereastreet.com/archive/200709/how_to_create_an_unobtrusive_print_this_page_link_with_javascript/
I agree with the author that ctrl-p could simply be pressed for a similar result instead of adding a button - but the print style would still help in that.
You know what...I just realized something. You will not be able to print a page that is more than one page! Ouch.
I know this is a very old questions, but we came across this and chose the following solution.
We downloaded an IE Tab extension(this is one there are several more) for FireFox and then configured that extension to use IE to render the report server URL by default.
You could easily create a how-to web page,pdf, or maybe even create a dummy report that shows the instructions on how to do this to your end users and then you're all set.
So now every time the report server website is accessed it's being rendered in IE so the print button shows up. Every windows machine already has IE so no compatibility issue there, unless you're not using windows. :)
My best suggestion would be from within Firefox export it to PDF and then print it from your PDF viewer. In my experience this is a better way to print the reports anyway.
Hope that helps!

ReportViewer - LocalReport - Merge reports?

I'm using ReportViewer WinForms, and since it is no easy way to create an coversheet, then I wonder, is it possible to render two reports and have them concatenated?, so they appear as one report?
If I was to print only, then I could execute two reports after each other, but since the user want to see the report before printing (you know, no environment waste here) then they have to appear in the same viewer.
OR, is there other ways of creating coversheets?
Today I use an subreport, but there are some issues with margins etc. which is not easy to fix.
To clarify, we are talking about
ReportViewer using RDLC files, no
Crystal Reports involved.
Do you need to display the 2 reports as 1 in the reportViewer control or would having them both exported to PDF and showing a single PDF containing both reports be satisfactory?
I was looking for that but using the Web ReportViewer and found examples exporting the reports to several PDFs, then concatenating the PDFs into 1 using PDFtk (free)
Blog post about using PDFtk and Reporting Services
Multiple RDLC reports displayed at the same time
PDFtk web site
I've created a report that sounds like what you are attempting to do...first to clarify, I'm going to guess your using Crystal Reports within VS2005/2008.
If that's the case, all you need to do in the main report is create an additional section after your section that contains the "Cover Sheet" layout/data. In the section expert for the "Cover Sheet" section (in layout view, right click on section header bar, pick section expert in pop up menu..), check off the "New Page After" option.
Edit: After your update, I see you are using RDLC reports, and from my limited exposure to those, I can't recall an easy way to get to where you want to be. Though I'm pretty sure you may be able to pass multiple reports to the same report viewer in code.

Resources