none
export to excel template + c# RRS feed

  • Question

  • Hi,

    I want to seek help from you guys, I have a program that generates employee attendance using datagridview (C#):


    I want to export the values of this gridview to this excel template:

    and eventually print it in pdf but each employee should have different pages for their record.

    I hope you can help me on this. Thank you 


    Wednesday, January 9, 2013 9:16 AM

Answers

  • do not expect copy&paste ready code here. But this is what i would do:

    1. use EEPlus dll to generate excel file with your data

    2. open up generated excel in Excel app using automation and invoke SaveAs2 passing pdf format parameter

    optionally if i would like my app to run even without excel installed, i would manually assembly my pdf using pdfsharp dll

    Wednesday, January 9, 2013 9:37 AM
  • if this template is in >= 2007 file format then just do what i described - fill data using open xml sdk (which eeplus just wraps) and export to pdf.
    Thursday, January 10, 2013 8:03 AM

All replies

  • do not expect copy&paste ready code here. But this is what i would do:

    1. use EEPlus dll to generate excel file with your data

    2. open up generated excel in Excel app using automation and invoke SaveAs2 passing pdf format parameter

    optionally if i would like my app to run even without excel installed, i would manually assembly my pdf using pdfsharp dll

    Wednesday, January 9, 2013 9:37 AM
  • i have a fixed template and i want my data from my datagrid view exported on that pre-formated template..i can't post the pictures
    Thursday, January 10, 2013 3:14 AM
  • if this template is in >= 2007 file format then just do what i described - fill data using open xml sdk (which eeplus just wraps) and export to pdf.
    Thursday, January 10, 2013 8:03 AM