|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem printing the content of a datagrid
I need to send to print the registers in a datagrid. The registers displayed in the grid are selected with this function:
Private Sub Cmdmostrar_Click() Dim strConn As String, db As New ADODB.Connection, query As String numero = txtnumero.Text fecha1 = Mid(CDate(DTPicker1.Value), 4, 3) & Mid(CDate(DTPicker1.Value), 1, 3) & Mid(CDate(DTPicker1.Value), 7, 4) fecha2 = Mid(CDate(DTPicker2.Value), 4, 3) & Mid(CDate(DTPicker2.Value), 1, 3) & Mid(CDate(DTPicker2.Value), 7, 4) Adodc1.RecordSource = "SELECT fecha, hora, usuario, codigo, estado FROM log WHERE fecha >= #" & fecha1 & "# AND fecha <= #" & fecha2 & "# AND movil = '710" & numero & "' OR movil = '100" & numero & "' ORDER BY fecha, hora " Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 DataGrid1.Refresh End Sub To print the register I created a button that displays a report in my dataenvironment, the function is this: Private Sub cmdreporte_Click() If x = False Then DataEnvironment1.Log.Open End If DataEnvironment1.rsrptprint.Properties.Refresh DataEnvironment1.rptprint numero, fecha1 <========== Here itīs the problem, 2 parameters rep_print.Refresh rep_print.Show DataEnvironment1.rsrptprint.Close DataEnvironment1.Log.Close End Sub In my data environment I established 2 parameters, numero and fecha1. If I try with 3 parameters (fecha2) I get an error saying there is not enough memory to this action, so I tried with just the 2 I mentioned but I get another error, Data type mismatch, and I have tried to declare my variables as data, string and variant, still the same error. The only parameter that works fine is number (as string), the 3 variables are global and I am running out of ideas. I wouldnīt like to use textboxes instead of DTPickers, unless there is no other way of course. Maybe someone can help me out. Thanks for your time, I know itīs a very long thread but I wanted to be sure you guys got the idea. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Problem printing the content of a datagrid |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|