Well basically I am creating a visual studio addin at the moment in c#. I have looked everywhere that I could think of for the answer to this, but have yet to find the answer. All I am looking to do is handle certain events from DTE2, like build events, solution events etc. But yet when I do it the way that I would think it should be done, the functions for the events never get called in my code.
I was wondering if you can print a report without the report viewer?
Right now, a user can right click the ListView and select View Ticket and it will bring up a Windows Form with a report viewer in it (linkd to TicketView.rdlc) and it will view the printable version of the ticket.
Now on the same context menu I put a Print Ticket button. My intensions was the user can view the ticket in printable format then print it, or the user could just click the Print Ticket button and it would print it exactly like you would view it in the report viewer.
Right now my ViewTicket.cs (Windows Form) has the dataset, binding source, and table adapter. When this form is opened, the ID (SQL) is passed to the windows form. Then we fill the table adapter using the ID. Now my other forms didnt do it this way since they needed more input before viewing the report. It seemed when I tried this with the forms Load event it wouldn't work.
Here is how I passed the parameters during the Loading of the form (this DIDNT work)
ReportParameter parm = new ReportParameter;
parm = new ReportParameter("ID", ID.ToString());
Now this exact code would work if I put a button on the form and ran this code during the button click event. But its like the report can't refresh because the form is loading maybe? Not sure..
Anyways, so how exactly could I print this report without going to the report viewer? I understand I would need to pass the ID to the report still, but how do I skip the viewing the report with the reportviewer and printing it from there? How can I just go straight to printing the report with one click of a button?
how can i maximize my form when i click on maximize button on top right sid conner??? when i click it just maximize my form bu it didn't work for items in the Form i mean like ListView Boxes, text Boxes, etc....how can i do that?