Way to print out data on forms

Hi
I have an application that has many different forms (over 30 different forms) that users can fill out depending on their request. All that stuff is housed inside a database, a backend user is able to view a request queue chose a ticket and open it. The way i open the ticket is just use the same exact page/form but just populate the fields with the info from the database so that they can edit it if needed.

Anyways my question is how can i create a print button for each form in the easiest way? I know i can use crystal report to create pdf or excel files, but then i need to design that for each form as they are different and we dont have time for that. Is there anyway to simplify that process so that i can reuse it for all forms by just changing little things maybe?

Any help will be appreciated.
LVL 7
urir10Asked:
Who is Participating?
 
Death259Commented:
As SriVaddadi said, if you have a main form, add it there. Specifically if you have an MDIParent form. As for the Crystal reports, I a lot of times will have one report that reads from a dataset. Then depending on what report is needed, i will filter the data into the dataset and then the report will read from that dataset. I usually have a report parameter that will allow me to change the name of the report. Here's the example code to load the report.
public void loadReport(string sql, string reportName)
{
      SqlDataAdapter sqlDA = new SqlDataAdapter(sql, sqlConnection);
      someDataSet ds = new someDataSet();
      sqlDA.Fill(ds);
      Report1 report = new Report1();
      report.SetDataSource(ds.Tables[ds.Tables.Count - 1]);
      crystalReportViewer1.ReportSource = report;
      operationsReport.SetParameterValue("Report Name", reportName);
	crystalReportViewer1.Refresh();
}

Open in new window

0
 
SriVaddadiCommented:
Do you have a master page?  If you have a master page Just add the print button to the master page and every page has it.

If you don't have one. You can add one.

Check the below link

http://msdn.microsoft.com/en-us/library/wtxbf3hh.aspx
0
 
urir10Author Commented:
Thanks for the replies
I do have a master page, the thing i dont want to do is write and design the crystal report page for each form. I wanted to know if there was a way to print the html in a simple way so that i can reuse that code for each page.
0
 
radha01Commented:
I personally believe that the following is the best tutorial for the SSRS.
http://www.c-sharpcorner.com/UploadFile/robo60/StandaloneRDLCReports11142007183516PM/StandaloneRDLCReports.aspx

so please go to this and follow it
it will guide you to your goal
0
 
urir10Author Commented:
Thanks i will use your suggestions and will post again if i have questions
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.