I have a big problem, I am generating an application that generates certain reports in excel, I have some formats that I develop, the problem is that I do not know how to fill them automatically according to a selected value (Example: if I select a car number , that generates the report for that number with the corresponding values), I fill that format manually but with the records that are already in the base. if a new element is registered obviously the report could not be generated. I give you an example of how I do it:
In this part I declare the connection and the value I want to select:
Dim ds_numpte As DataSet = conexion_Baan.selectTable("Select numero From numero_parte")
If ds_numpte.Tables(0).Rows.Count <> 0 Then
Dim A As String = ds_numpte.Tables(0).Rows(0).Item(0)
End If
and in the format that I generated, I assign the value in the corresponding cell:
.Range("G4:H4").Merge()
.Range("G4:H4").BorderAround()
.Range("G4").Value = ds_numpte.Tables(0).Rows(0).Item(0)
.Range("G4").HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
There will be a way to fill the report that generates automatically ?? (eye: I know how to make a query appear in an Excel doc by means of a datatable, but the format it develops is more personalized)