print option is not displayed in report viewer - asp.net-mvc-4

I'm working on RDLC reports in ASP.NET, and rendering a report in a report viewer. It displays the print option at design time, but it disappears at runtime even if I set the property ShowPrint to true.

The print button unfortunately relies on ActiveX, which is only available on Internet Explorer, and so the print button is not present when using other browsers. You can still generate a .pdf file and then print that, effectively getting the same result.

Related

Using selenium drivers to Print to PDF

I am struggling with a problem.
I need to download PDF file when the Print dialog appears.
Here is an example of the dialog
I have tried both the chrome and firefox drivers. But unfortunately still cannot get it working.
I have found the following preference for the firefox
fp.setPreference("print.print_to_file", true);
But it seems that it doesn't work.
It doesn't even get applied into the configuration variables set.
Please suggest any way to automate some actions with selenium and then save to PDF file when this print dialog appears.
Firstly, you need to know selenium is a web automation tool. so it can only operate things belongs to browser. Even that, it can't operate all things belongs to browser, like address bar, favior bar, menu bar of browser.
For most case, the print dialog is not belongs to browser, it supplyed by OS or other software installed on OS. so selenium can't operate it is reasonable.
If your script code by java, you can use java.awt.robot to capture the dialog
and click 'print to file'.
If java.awt.robot can worked as your expect, I think you aslo need to set browser options in your script to give a path for browser to save the printed file, just like when you download file, browse will ask you where to save.
if you not to set that options, i guess it will pop-up another dialog to ask you where to save and this dialog is also not belongs to browser.
it's not easy to use java.awt.robot to set the save path.
Because you need to consider the possbility of script run on different OS, use abosulte path is not workable on different OS. Besides if your script run with seleniu grid, it will make you craze. So if testing print to file feature is not important, i recommend you test it manuall.
You can automate Print to PDF using Testmate as below
http://thetestmate.com/save-as-pdf-in-chrome-testmate-selenium/

Solution for silent-kiosk print on CefSharp?

I want to print my web page silently ( to default printer) with "window.print()" command on CefSharp. CefSharp handles the documents and print very good but i can't prevent printer dialog screen. Is there any option or method to prevent printerdialog ?
DotNetBrowser provides silent print functionality but it has page scrolling problem and it is slower than ChefSharp.
Thanks

PDFtron close a tool when doing Frame.GoBack()

Im using PDFtron on a windows store app project.
I have a page with a back button and a pdf viewer where i can edit the pdfs.
When im editing a pdf i have a tool bar with options like the ones in the samples, but i have a issue when i choose a Free Text tool and start writing on the pdf, if i press the back button while the Free Text tool is active ( the cursor is bliking) the text i wrote appears in the screen on the next page i navigate to.
How can i solve this?
The TextBox in question is part of the PDFViewCtrlTools that are used to create annotations. It is shipped with the sample application and is fully open source.
The TextBox is inside a popup, positioned to align itself on top of the PDFViewCtrl in the position where you tapped.
This TextBox needs to be closed before you go back. It is quite easy to do so by calling ToolManager.CreateDefaultTool(). In general, I would recommend taking a look at the samples and see what they're doing when the user tries to navigate away from the page.
Everytime you navigate away from a page with PDFViewCtrl, the ToolManager should call CreateDefaultTool so that whatever current tool is active (in this case the FreeTextCreate tool) can close itself and clean up.

"Action - Go to report" in VS2008 reportviewer not working

I have an SSRS report which drills through to sub reports via actions. The report functions correctly in the VS environment, and correct once deployed to the server and viewed through a browser.
The report however is also viewed inside our in-house app via a Microsoft.Reporting.WinForms.ReportViewer - and while it renders on screen correctly, clicking the element that would normally take me to a sub-report no longer functions.
I have had a look around and there seemed to be an issue around VS2010 SP1 where this stopped working, however I'm currently stuck with VS2008. This seems to be the majority of results I'm getting.
Anyone have any ideas?
Many thanks.
OK have found issue.
The text box in question had three place holders. A reference No, A date and an age. I wanted to trigger the sub report if someone clicked on the reference no. While this worked fine in VS and IE, it failed to work in the Microsoft Report Viewer control.
I have now set the action against the containing text box, rather than against a single placeholder/expression within that box. While this has solved the immediate issue that I have, it would not work if you wanted multiple actions from different placeholders in a single text box.
But for now, I'm all good, and all solved.

is it possible to close MS Windows print pop up window using selenium

is it possible to close print pop up window using selenium..
Scenario is, on clicking print icon a pop up opens with preview and on top of it MS Windows Print pop up comes.
I could able to do validation in the preview window but unable to close the window because the presence of MS Windows print. SO this window always present in open state while executing other cases, i mean my cases are running but its blocking the view, almost half screen.
So i want to close the MS Windows Print pop-up and the i can close the preview window by selenium because it has 'Close' link
Computer Says No.
from the selenium cor faq :
...Currently there is not much that can be done about IE modal
dialogs.
I have a messy workaround right now that involves using AutoIT (http://www.autoitscript.com/site/autoit/) to just press alt + f4, I wrote a simple script, compiled it, and called it from my C# code, that I'm running on Selenium RC. I'm looking for a better way now since this is only a workaround, a quick fix allowing me to run it until I can write it in a cleaner way.
Code for AutoIT:
; Script Start
WinClose("Window Name")
C# Code
Process.Start("WindowClose.exe");