Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SaveFileDialog^ sfd = gcnew SaveFileDialog();
- String ^ HTMLWay;
- sfd->Title = "Save HTML";
- sfd->OverwritePrompt = true;
- sfd->CheckPathExists = true;
- sfd->Filter = "Html files (*.html)|*.html|All files (*.*)|*.*";
- sfd->ShowHelp = true;
- if (sfd->ShowDialog() == Windows::Forms::DialogResult::OK)
- {
- try
- {
- StreamWriter ^ NewHTML = gcnew StreamWriter(sfd->FileName);
- NewHTML->WriteLine("<html>");
- NewHTML->WriteLine("<head>");
- NewHTML->WriteLine("<title>My Report</title>");
- NewHTML->WriteLine("</head>");
- NewHTML->WriteLine("<body>");
- NewHTML->WriteLine("My Amount: " + Result_of_Amount->Text + "<br>");
- NewHTML->WriteLine("Iterations: " + IterationsRes->Text + "<br>");
- NewHTML->WriteLine("Size of amount: " + SizeBox->Text + "<br>");
- NewHTML->WriteLine("My Massive[i][j]:<br>");
- for (int i = 0; i < numericUpDown2->Value; i++) {
- for (int j = 0; j < numericUpDown1->Value; j++) {
- if (j != Convert::ToInt32(numericUpDown1->Value) - 1) {
- NewHTML->Write(Convert::ToString(Convert::ToInt32(dataGridView1->Rows[i]->Cells[j]->Value)) + " ");
- }
- else {
- NewHTML->Write(Convert::ToString(Convert::ToInt32(dataGridView1->Rows[i]->Cells[j]->Value)) + "<br>");
- }
- }
- }
- NewHTML->WriteLine("<br>");
- NewHTML->WriteLine("<img src= "Report.bmp""alt="Report">");
- NewHTML->WriteLine("</body>");
- NewHTML->WriteLine("</html>");
- NewHTML->Close();
- }
- catch (...)
- {
- MessageBox::Show("You can save it", "ERROR", MessageBoxButtons::OK, MessageBoxIcon::Error);
- }
- }
- private: System::Void HTMLOpen_Click(System::Object^ sender, System::EventArgs^ e) {
- OpenFileDialog^ open = gcnew OpenFileDialog();
- open->Filter = "Html files (*.html)|*.html|All files (*.*)|*.*";
- if (open->ShowDialog() == Windows::Forms::DialogResult::OK)
- {
- webBrowser1->Navigate(open->FileName);
- }
- }
Add Comment
Please, Sign In to add comment