We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DocIO Mail merge with Oracle database

Thread ID:

Created:

Updated:

Platform:

Replies:

101507 Oct 30,2011 10:37 PM UTC Nov 10,2011 09:07 AM UTC Windows Forms 3
loading
Tags: DocIO
W. ter Horst
Asked On October 30, 2011 10:37 PM UTC

Hello,

I have an Oracle database and I would like to use DocIO to fill the customers fields in a letter from a table of that database. How can i do that with Oracle?

Thanks


Poornima R [Syncfusion]
Replied On November 4, 2011 12:44 PM UTC

Hi Horst,

Thank you for your interest in Syncfusion Products.

Regarding your query “Using Oracle data base in mail merging”:
Please try using the following two steps to use oracle database in mail merge
1) Initially oracle database should be connected to the client application. Once the data base is connected the required table needs to be populated in the DataSet. Please find the following code snippet illustrating the same

//Create an instance for oracle connection
OracleConnection conn = new OracleConnection();
//Set connection string
conn.ConnectionString = "Data Source=" + ";Integrated Security=yes";
//Open connection
conn.Open();
//Create oracle command
OracleCommand command = new OracleCommand("Select * from Employees", conn);
//Create an instance for dataset
DataSet ds = new DataSet();
//Create oracle data adapter
OracleDataAdapter oraDa = new OracleDataAdapter(command);
//Fill dataset
oraDa.Fill(ds, "TableName");

2) Once the data set is populated using the above code, mail merging can be performed in DocIO using the populated data set as in the below code

// Creating a new document.
WordDocument document = new WordDocument();
// Load template
document.Open("Input.doc", FormatType.Doc);

// Execute Mail Merge with groups.
document.MailMerge.ExecuteGroup(ds.Tables["TableName"]);
// Saving the document to disk.
document.Save("output.doc",FormatType.Doc );

To know more about mail merging, please refer the below online documentation and UG link

Online documentation link:
http://help.syncfusion.com/ug_94/Reporting/DocIO/ASP.NET/default.htm?turl=Documents%2F46mailmerge.htm

Online sample link:
http://asp.syncfusion.com/sfaspnetsamplebrowser/9.4.0.62/Web/DocIO.Web/Samples/4.0/Mail%20Merge/LetterFormatting/CS/LetterFormatting.aspx

http://asp.syncfusion.com/sfaspnetsamplebrowser/9.4.0.62/Web/DocIO.Web/Samples/4.0/Mail%20Merge/EmployeeReport/CS/EmployeeReport.aspx

http://asp.syncfusion.com/sfaspnetsamplebrowser/9.4.0.62/Web/DocIO.Web/Samples/4.0/Mail%20Merge/Mail%20Merge%20Event/CS/Mailmerge_Event.aspx

http://asp.syncfusion.com/sfaspnetsamplebrowser/9.4.0.62/Web/DocIO.Web/Samples/4.0/Mail%20Merge/NestedMailMerge/CS/NestedMailMerge.aspx

Please let us know if you have any questions.
Regards,
Poornima





W. ter Horst
Replied On November 7, 2011 08:24 PM UTC

Thanks for the reply,

I have some views can I use a view to merge data in a letter?


Gunasekaran T [Syncfusion]
Replied On November 10, 2011 09:07 AM UTC

Hi Horst,

Thank you for your update.

Yes, you can use view to merge data using mail merge functionality of DocIO. For merging the data from the Views please use the SQL command mentioned below.

SQL command to merge data from Views:
SELECT * FROM

Example: SELECT * FROM EmployeesView.
EmployeesView is the view created for the table Employees.

Please let me know if you have any queries.

Regards,
Gunasekaran




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;