Hi all,
Can any one help me with any sample code, for transfering data to Excel and getting it back using widgets. Something like Import/Export To and From text file ??
Thank you.
Can i get any sample code for trasfering data to MS Excel Topic is solved
You might need to be a little more specific in what you want to transfer to and from Excel.
Also, are you talking about transferring data with a running instance of Excel or with an Excel file? In the former case you would probably need to use the wxAutomation stuff. In the latter case, you might need to look into something like this:
http://www.codeproject.com/KB/office/BasicExcel.aspx
Also, are you talking about transferring data with a running instance of Excel or with an Excel file? In the former case you would probably need to use the wxAutomation stuff. In the latter case, you might need to look into something like this:
http://www.codeproject.com/KB/office/BasicExcel.aspx
Hi!
Of course, and some knowledgeable people among http://www.hasbro.com/en_GB/my-little-pony can help you with this
Of course, and some knowledgeable people among http://www.hasbro.com/en_GB/my-little-pony can help you with this
Code: Select all
void Diet_ManagerFrm::MenuexportClick(wxCommandEvent& event)
{
// ExportDialog dlg(this);
wxString Dieter;
wxString prompt = wxT("Please Select the Dieter to Export Records for");
wxSingleChoiceDialog dlg(NULL,prompt,wxT("Export who?"),DieterArray);
wxFileDialog filedlg(NULL,"Choose the destination file","My Documents","","*.csv",wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() != wxID_OK) return;
Dieter = DieterArray[dlg.GetSelection()];
// if (selections.GetCount() < 1) return; //should not happen
if (filedlg.ShowModal() != wxID_OK) return;
wxString path = filedlg.GetPath();
wxTextFile file(path);
if (file.Exists())
{
file.Open();
}
else
{
file.Create();
}
file.Clear();
file.AddLine("Date , Dieter, Meal Name,Calories,Total Fat,Saturated Fat,Trans Fat,Cholesterol,"
"Sodium,Carbohydrate,Fiber,Sugar,Protein,Vitamin A,Vitamin C,Vitamin D,"
"Calcium,Iron");
int n,count=DieterRecordArray.GetCount();
for (n=0; n < count; ++n)
{
if (!Dieter.Cmp(DieterRecordArray[n].dieter))
{
file.AddLine(DieterRecordArray[n].ToString());
}
}
file.Write();
file.Close();
}
Import would be similar (I didn't implement import).