I need to create a new bi-dimensional String array like this one:
-- Create Header and Data
String[] Header ={"Item","Description", "Qty","Unit Price","Price"};
String[][] data = {
new String[]{"Spire.Doc for .NET",".NET Word Component","1","$799.00","$799.00"},
new String[]{"Spire.XLS for .NET",".NET Excel Component","2","$799.00","$1,598.00"},
new String[]{"Spire.Office for .NET",".NET Office Component","1","$1,899.00","$1,899.00"},
new String[]{"Spire.PDF for .NET",".NET PDFComponent","2","$599.00","$1,198.00"},
};
But "data" is declared on the code, the problem is that I need to declare "data" with the data (sorry about repeating "data" multiple times) of an unknown length array[n], so the code could work like:
String[][] data = {
new String[]{"arrayFromFunction[0].data1","arrayFromFunction[0].data2","arrayFromFunction[0].data3","arrayFromFunction[0].data4","arrayFromFunction[0].data5"},
new String[]{"arrayFromFunction[1].data1","arrayFromFunction[1].data2","arrayFromFunction[1].data3","arrayFromFunction[1].data4","arrayFromFunction[1].data5"},
...
new String[]{"arrayFromFunction[n].data1","arrayFromFunction[n].data2","arrayFromFunction[n].data3","arrayFromFunction[n].data4","arrayFromFunction[n].data5"}
};
But I don't know how to iterate INSIDE the declaration of String[][] data or how to save the iterator (n) to use it inside data declaration.
Hope I've explained well and thanks for your help.