Click here to Skip to main content
15,886,783 members

Comments by Mateo Hernández (Top 6 by date)

Mateo Hernández 23-Aug-15 11:33am View    
Deleted
Hi, guys! I solved my problem.
Without going into unnecessary details, here's part of my code:
<pre lang="c++"></pre><pre lang="cs">Excel::Application^ ExReport = gcnew Excel::ApplicationClass();
if (ExReport == nullptr)
{
MessageBox::Show(L"** Error. La aplicación Excel de Microsoft Office no está instalada **");
}
else
{
ExReport->DisplayAlerts = false;
ExReport->Visible = false;
if (Matrix::Archivo_Existe(Glo::m_file_reporte_excel) == L"1")//Glo::m_file_reporte_excel
{
m_case = L"1";
Workbook^ Wbook1 = ExReport->Workbooks->Open(Glo::m_file_reporte_excel, Type::Missing, Type::Missing,
Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing,
Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing);
ExReport->Sheets->Add(Type::Missing, Type::Missing, Type::Missing, Type::Missing);
}
else
{
m_case = L"0";
Workbook^ Wbook1 = ExReport->Workbooks->Add(Type::Missing);
ExReport->SheetsInNewWorkbook = 1;
}
//
Worksheet^ Wsheet1 = safe_cast<Worksheet^>(ExReport->ActiveSheet);
Wsheet1->Name = Glo::m_num_seccion;
int m;
for (m = 0; m < 5; m++)
{
ExReport->Cells[m + 1 , 1] = Matrix::Data0[m];
}
//
int i;
int j = 5;
for (i = 0; i < Matrix::Data1->Length; i++)
{
//MessageBox::Show(L"i: "+i.ToString());
switch (Matrix::Info_Seccion1->Length)
{
case 1:
{
ExReport->Cells[i+j+1, 1] = Matrix::Data1[i];
ExReport->Cells[i+j+1, 2] = Matrix::Data2[i];
ExReport->Cells[i+j+1, 3] = Matrix::Data3[i];
ExReport->Cells[i+j+1, 4] = Matrix::Data4[i];
ExReport->Cells[i+j+1, 5] = Matrix::Data5[i];
ExReport->Cells[i+j+1, 6] = L"'"+Matrix::Data6[i];
break;
}
case 2:
{
ExReport->Cells[i+j+1, 1] = Matrix::Data1[i];
ExReport->Cells[i+j+1, 2] = Matrix::Data2[i];
ExReport->Cells[i+j+1, 3] = Matrix::Data3[i];
ExReport->Cells[i+j+1, 4] = Matrix::Data4[i];
ExReport->Cells[i+j+1, 5] = Matrix::Data5[i];
ExReport->Cells[i+j+1, 6] = Matrix::Data6[i];
ExReport->Cells[i+j+1, 7] = L"'"+Matrix::Data7[i];
break;
}
case 3:
{
ExReport->Cells[i+j+1, 1] = Matrix::Data1[i];
ExReport->Cells[i+j+1, 2] = Matrix::Data2[i];
ExReport->Cells[i+j+1, 3] = Matrix::Data3[i];
ExReport->Cells[i+j+1, 4] = Matrix::Data4[i];
ExReport->Cells[i+j+1, 5] = Matrix::Data5[i];
ExReport->Cells[i+j+1, 6] = Matrix::Data6[i];
ExReport->Cells[i+j+1, 7] = Matrix::Data7[i];
ExReport->Cells[i+j+1, 8] = L"'"+Matrix::Data8[i];
break;
}
case 4:
{
ExReport->Cells[i+j+1, 1] = Matrix::Data1[i];
ExReport->Cells[i+j+1, 2] = Matrix::Data2[i];
ExReport->Cells[i+j+1, 3] = Matrix::Data3[i];
ExReport->Cells[i+j+1, 4] = Matrix::Data4[i];
ExReport->Cells[i+j+1, 5] = Matrix::Data5[i];
ExReport->Cells[i+j+1, 6] = Matrix::Data6[i];
ExReport->Cells[i+j+1, 7] = Matrix::Data7[i];
ExReport->Cells[i+j+1, 8] = Matrix::Data8[i];
ExReport->Cells[i+j+1, 9] = L"'"+Matrix::Data9[i];
break;
}
}
}
//
Excel::Range^ er1 = Wsheet1->
Mateo Hernández 19-Aug-15 9:55am View    
Thank you!
Mateo Hernández 19-Aug-15 9:55am View    
Thank you!
Mateo Hernández 17-Aug-15 3:00am View    
What good is a 11,674,641 member forum if nobody wants to help?
Mateo Hernández 16-Aug-15 11:52am View    
Thank you for your suggestion.