Click here to Skip to main content
14,640,654 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi ,

Process :

Reports are being generated in excel. then it is converted as pdf.
So , How to merge multiple excel files to single excel to convert as one pdf.

Thank you,
B.Velmurugan
Posted
Comments
   
Why not simply combine several Excel documents in one PDF?
--SA

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

One option is as follows:

1. Create a new excel file using Microsoft.Office.Interop.Excel.
2. Open each of the excel file and write contents to the newly created excel file.
3. Save the newly created excel file.
4. Generate the PDF file from the newly created excel file.

An example for using Microsoft.Office.Interop.Excel is given here.
http://msdn.microsoft.com/en-us/library/ms173186(v=vs.80).aspx[^]
   
v2
Comments
   
Please see my comment to the question. Isn't that better?
--SA
ProEnggSoft 23-Mar-12 0:58am
   
Do you mean from Excel application? I could not get the point. Can you please elaborate. I was thinking that the OP wants to generate combined excel file from within C# program. Thank you
   
Not too much to elaborate...

I mean: open one Excel file, get data, create PDF data, add to PDF document, open another Excel file, append/insert to the same PDF document...

In "to single excel to convert as one DPF" OP never mentioned that "single excel" is needed by itself. Why complicate a simpler problem?

--SA
ProEnggSoft 23-Mar-12 1:26am
   
Thank you. I understood. You are correct.

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100