0
votes

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

1
I am looking for exactly the same. Subscribing to this threadMartin

1 Answers

2
votes

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.