Hi
I create a report that has some code behind the BeforePrint event for 3 labels, in two of the the code is for validate a date and in the other is for join to fields and present the result in the report. All works fine.
My problem is that I provide tthe layout of the reports in case they want to change the report layout. So I save the report from the designer as Report.repx
In the window that calls the report I have this in a Try Catch fist try load the layout in case that can not be found, then the report of the application is loaded. Again this works fine.
Using loReport As New ListadoGuias
Try
Dim FilePath As String = Application.StartupPath & "\Reportes\ListadoGuias.repx"
loReport.LoadLayout(FilePath)
loReport.Name = "Listado de guías para envíos"
loReport.ExportOptions.PrintPreview.DefaultFileName = "Listado de guías para envíos"
loReport.ShowPreviewDialog()
Catch
loReport.Name = "Listado de guías para envíos"
loReport.ExportOptions.PrintPreview.DefaultFileName = "Listado de guías para envíos"
loReport.ShowPreviewDialog()
End Try
End Using
The problem is that the code is not executed from the layout and I really need the reports executes the code in order to show the data correctly.
I try using Scripts, but I can not this to work.
Hope you can help me.
Regards