Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - how to export ReportControl data
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to export ReportControl data

 Post Reply Post Reply
Author
Message
lwg191 View Drop Down
Newbie
Newbie


Joined: 05 June 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote lwg191 Quote  Post ReplyReply Direct Link To This Post Topic: how to export ReportControl data
    Posted: 05 June 2006 at 2:15am

how export ReportControl data to a txt file or a excel file?

thanks

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2006 at 9:32am
Hi,

First of all you can simply copy/paste your records from/to Excel and txt files.

If you'd like to do it programmatically, please specify your environment.

--
WBR,
Serge
Back to Top
lwg191 View Drop Down
Newbie
Newbie


Joined: 05 June 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote lwg191 Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 9:14am

sserge:
thank you for your reply!

I'd like to do this programmatically,my develop environment is VC++7.0+Win2000.
Could you give me some samples for this (export data to excel or txt file)?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 5:37pm
An example of storing Report Control data in XML file exist in the ReportSample. See method CReportSampleView::SaveReportState, or below:

CXTPPropExchangeXMLNode px(FALSE, 0, _T("ReportControl"));
CXTPPropExchangeSection secRecords(px.GetSection(_T("Records")));
GetReportCtrl().GetRecords()->DoPropExchange(&secReco rds);
px.SaveToFile(_T("c:\\ReportControl.xml"));


With other CXTPPropExchange derived classes you can save data to other formats. There are no native support for Excel files, but it can easily open generated XML file.

--
WBR,
Serge
Back to Top
lwg191 View Drop Down
Newbie
Newbie


Joined: 05 June 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote lwg191 Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 8:33pm
thank you
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.