rdlc print auto generate - c#-2.0

I am developing the window application using C#. I am using the reportviewer to display rdlc. I just require following things:
1). Print rdlc without viewing it Client will click on print button and print should go System default printer.
2). if System default printer is not available/working then it will prompt for alternative.
i don't want to use xml file

Here is what you need to do is load your report and data into the report viewer and then render the report pages into list of memory streams and print them using then PrintDocument Class here as an expample how it is done link. For the part where it asks the user if it doesn't find default printer change
if (!printDoc.PrinterSettings.IsValid)
{
throw new Exception("Error: cannot find the default printer.");
}
in the Print()method with the showing of PrintDialog for user to select printer.

Related

Remove option to Print to PDF

When clicking the print button for my Crystal report, I see this:
I don't want to Export to PDF first, I just want to print immediately when the Print button is pushed. How can I configure this behavior?
Sounds like you want to use the PrintToPrinter method. According to MSDN:
Prints the specified pages of the report to the printer selected using the PrintOptions.PrinterName property. If no printer is selected, the default printer specified in the report will be used.
You'll need to pass the number of copies, whether or not it should be coallated, and the start/end pages as parameters. Something like:
public void PrintToPrinter (5, false, 1, 3);

Multiple-page print or Reporting library for Vaadin 7 UI

We had a Vaadin 7 UI page with multiple Layouts, Panels, and Chart (the Browser will come with ScrollBar as height is big). When we try to print using JavaScript in Vaadin code or using Ctrl+P of browser, it prints only One page in Firefox 32.0.3; prints multiple pages with only data for First Page in IE 8.
We tried with specifying undefined size for all components in UI page
(as mentioned in https://vaadin.com/forum#!/thread/3869543/7861633)
We also tried with some CSS changes for print (as mentioned in https://vaadin.com/forum/#!/thread/529738/539201)
Both above cases didnot solved our problem. As we can understand from documentation that Vaadin scrolling uses a DOM structure, it was unusual to know such a tool does not provide proper Print option.
To brief our objective, we are looking at Reporting option in Vaadin for some data analysis. We saw some options (using JasperReport etc.) mentioned in StackOverflow, however will not be able to implement them as we need to deploy this application to Google App Engine (GAE) which has unsupported functions such as FileOutputStream etc.
To conclude, these are our issues -
How to resolve multiple page print issue in Vaadin 7?
If we are not able to solve first issue, What is the best Reporting library (for PDF or PNG or HTML or Print) that is supported by both Vaadin 7 and GAE?
Any guidelines or suggestions to direct us would be appreciated.
Printing HTML pages is random at best.
Every browser has it's own rules for display and page breaks. We always use pdf for things to print.
iReport / Jasperreports is the thing we use most of the time
You can try this workaround:
private void setSizeUndefined2Print()
{
com.vaadin.ui.JavaScript.getCurrent().execute("document.body.style.overflow = \"auto\";" +
"document.body.style.height = \"auto\"");
UI.getCurrent().setSizeUndefined();
this.setSizeUndefined();
}
If for some cases you need to switch back to "defined" size, next method can be used:
private void setSizeFull2Print()
{
com.vaadin.ui.JavaScript.getCurrent().execute("document.body.style.overflow = \"\";" +
"document.body.style.height = \"\"");
UI.getCurrent().setSizeFull();
this.setSizeFull();
}

can I force Outlook 2007 rule to print first page only?

I have set up a rule to quite simply print out an email when received from a certain address (Amazon sales) - The idea being that as orders come in, they are auto printed and waiting to be packed.
However the amazon emails require 2 pages.
under the Rules menu in Outlook, the option is simply "Print" but no further print preferences are available.
Is there a way to get it to print the first page only? a script possibly?
No, Outlook Object Model does not porvide any fine controls over the print functionality. As a workaround, you can export the message as a DOC file (MailItem.saveAs), then programmatically load it in Word and use the Word Obejct Model to print it.

How to save users changes in FastReport

In Delphi 2009 I install Fast Report 4.8, and create some reports. In my application I use these reports like this:
myfrxReport.ShowReport();
Now some users want to edit the report page, so I use frxDesigner.
But my problem is: "How can I save users changes ?"
Use the report as file, then the user can override that report file in the designer. Next time the report is loaded, the user loads the modified report.
frxReport.LoadFromFile(aFileName); //The report filename with the user changes
frxReport.PrepareReport(true);
frxReport.ShowReport;
Check also the frxDesigner.Restrictions options!
u can this code :
if not FrxReport.LoadFromFile(AFileName) then
FrxReport.DesignReport
else if TAppUtils.Confirm('You Have Authority To Design Report. Do You Want To Design Report ?') then
FrxReport.DesignReport
else
FrxReport.ShowReport(True);
TAppUtils.Confirm : It is method to confirm user to do something or not

Is it possible to print to a specific printer and tray from code?

I have an application that creates two reports. The first report is created and shown in a ReportViewer window, when the user clicks the next button (custom button), the second report is shown in a different ReportViewer window.
Within each ReportViewer window, the user can click print and see a print dialog window and print the report.
I would like to have them click print in the first ReportViewer window and the report print to a specific tray on a specific printer. When they click print on the second ReportViewer window, I would like it to print to a different tray on the same printer. I do not want to show them the print dialog.
Is this possible using the 4.0 .Net Framework or some 3rd party component?
Yes.
For example. Crystal Reports objects have printer options that include:
objReport.DefaultPrinterDomain = ""
objReport.DefaultPrinterName = ""
objReport.DefaultPrinterTray = ""
objReport.DefaultPrinterIP = ""
objReport.DefaultAutoPrint = 0
I'm not as familiar with other reporting software or with the specific .net framework items that may do this iself. But if crystal can do it i'm sure there are other ways to do it as well.

Resources