Export to excel - InfoPath Dev
in

InfoPath Dev

Export to excel

Last post 03-22-2011 08:33 AM by ashoke. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-23-2010 01:13 AM

    Export to excel

    Hi. I would like to know how would it be possible to export to excel the information from SQL database using InfoPath customized code. To be more accurate: I extract some information from the database on the form in a repeating table for example and the information I see on the form I want to export it to excel. I am also interested in any form of reports I can create in InfoPath, so any suggestion is welcome. Thank you!

  • 03-22-2011 08:33 AM In reply to

    • ashoke
    • Not Ranked
      Male
    • Joined on 02-24-2011
    • Toronto, Canada
    • Posts 21

    Hi There, Hope you've already done it by this time. Here is my solution to export to Excel by clicking a button for one of my query forms. If you have query, please let me know. Thanka, Ash

    XPathNavigator DOM = DataSources["qYear"].CreateNavigator();

    string qyear = DOM.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:qYear/@qYear", this.NamespaceManager).Value;

    string period = this.MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:queryFields/q:top/@Period", this.NamespaceManager).Value;

    string filename = qyear + "_" + period;

    this.CurrentView.Export(@"G:\...\Trends_totaltrans_" + filename + ".xls", ExportFormat.Mht);

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.