Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I like to be able to make a form online, user enters data such as name, adresse etc.

The data a user enters in the web form will be implemented in a PDF and automatically emailed to user for signature.

How is that done?
Posted
Comments
CHill60 29-Jan-15 9:17am    
This is a quick answers forum and your question does not lend itself to a quick answer. Do some research, and come back if you have a specific problem

Did you try anything yet, if you have post that code.

If its in asp.net and c# below's the soln

You can try using Crystal reports for PDF emailing of the form data.

after data goes to the db, write an sp to get it back and call that in the crystal report.

then invoke it from .cs like

C#
ExportOptions crExportOptions;
        DiskFileDestinationOptions crDiskFileDestinationOptions;
        String ExportPath;
        string ReportFileName = "myreport.rpt";
        

        ReportDocument report = new ReportDocument();
        report.Load(Request.PhysicalApplicationPath + "Reports\\" + ReportFileName, OpenReportMethod.OpenReportByTempCopy);
 report.SetParameterValue("Parameter", paramvalue);

  ExportPath = @"C:\foldername\";
        if (!Directory.Exists(ExportPath))
        {
            Directory.CreateDirectory(ExportPath);
        }
        StringBuilder sbTemp = new StringBuilder(ReportFileName);

        sbTemp.Replace(".rpt", string.Empty);
        String fname, fTempName;
        fTempName = sbTemp + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + "Pc.pdf";
        fname = ExportPath + fTempName;
        fname.Replace("  ", "");
        fname.Replace(" ", "");
        fname.Replace(":", "");
        fname.Replace("/", "");
        // Set the path for the exported report
        crDiskFileDestinationOptions = new DiskFileDestinationOptions();
        crDiskFileDestinationOptions.DiskFileName = fname;

        // Set the options to export the report to PDF
        // format
        crExportOptions = report.ExportOptions;
        crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
        crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

 ConnectionInfo crConnection = new ConnectionInfo();

        crConnection = //connectionstringinfo

        ConfigureCrystalReport(report, crConnection);

report.SetDatabaseLogon(crConnection.UserID, crConnection.Password, crConnection.ServerName, crConnection.DatabaseName);

report.ExportToDisk(ExportFormatType.PortableDocFormat, fname);

 var content = File.ReadAllBytes(fname);

        Response.Clear();
        Response.ContentType = "application/pdf";
        Response.AddHeader("Content-Disposition", "attachment;filename=myreport.pdf");
        Response.BinaryWrite(content);
        File.Delete(fname);
        report.Close();
        report.Dispose();
        GC.Collect();
        Response.End();



And then email using it as attcmnt
 
Share this answer
 
v2
You can use jsPDF[^] which generates PDF in JavaScript. Here are some jsPDF demos:
1. http://jsfiddle.net/xzZ7n/1/[^]
2. http://ngiriraj.com/pages/htmltable_export/demo.php[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900