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. Image for the cookie policy date

Creating worksheet from a template worksheet.

I have a template file, which i am creating multiple sheets of in a new Workbook.  All the data shows up fine but the data decides to format itself differently than what the template file is formatted for.  It changes font, sometime font size and weight, and reformats the cell number formatting. Below is my code on creating the sheet from the template.  Let me know if you need to see my entire class.



IApplication application = excelEngine.Excel;

//Open the template workbook
IWorkbook templateWorkbook = application.Workbooks.Open(path);
 
//Get the template worksheet
IWorksheet templateSheet = templateWorkbook.Worksheets[0];

//Open a workbook with a blank sheet
IWorkbook workBook = application.Workbooks.Open(blankPath);

//Copy the template sheet to the blank sheet workbook
IWorksheet sheet = workBook.Worksheets.AddCopy(templateSheet);

//move the sheet to the front of the line                
sheet.Move(0);

3 Replies

SS Sridhar Sukumar Syncfusion Team May 26, 2016 08:43 AM UTC

 Hi Mike, 
  
Thank you for contacting Syncfusion support. 
We are unable to reproduce the reported issue from our side. We have shared the sample for your reference which can be downloaded from following location.  
Kindly modify the sample and share us the issue reproducing sample or input Excel file which will be helpful for us to provide prompt solution at the earliest. 
Regards 
Sridhar S 



MR Mike Rosenberger May 26, 2016 01:03 PM UTC

I have taken the files you have sent me and modified it to use our templates and encounter the same issues.  It is changing some of the text to calibri from times now roman and un-centering some of the fields.  I included the edited code and documents.  You can look at the output file to see my results.

Attachment: Template_worksheetUpdated_99c6c25d.zip


SS Sridhar Sukumar Syncfusion Team May 27, 2016 06:32 AM UTC

Hi Mike, 

  

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 

  

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

  

Please let me know if you have any questions. 

 

Regards 

Sridhar S. 



SIGN IN To post a reply.
Loader.
Up arrow icon