BAQ Report Dialog Boxes - Default Dates

I have this working now. When the BAQ print dialog box is up it is holding
the date in 'field1', 'field2', etc. When the printing function occurs it
appears to hand off these field values to the associated 'option1',
'option2' fields and leaves the others behind.

Here is the final example code. Works well.

This example is for four date boxes to duplicate the Sales Order Backlog
look another report.

'//**************************************************
'// Custom VB.NET code for BAQReportForm
'// Created: 5/21/2009 9:33:02 AM
'//**************************************************
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Microsoft.VisualBasic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization
Imports Epicor.Mfg.UI.Adapters
Imports Epicor.Mfg.UI.Searches


Module Script


'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard
Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

'// End Wizard Added Module Level Variables **


'// Add Custom Module Level Variables Here **


Sub InitializeCustomCode()


'// ** Wizard Insert Location - Do not delete 'Begin/End
Wizard Added Variable Intialization' lines **
'// Begin Wizard Added Variable Intialization

'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub



Sub DestroyCustomCode()


'// ** Wizard Insert Location - Do not delete 'Begin/End
Wizard Added Object Disposal' lines **
'// Begin Wizard Added Object Disposal

'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub



Private Sub BAQReportForm_Load(ByVal sender As object, ByVal args As
EventArgs) Handles BAQReportForm.Load
'//
'// Add Event Handler Code
'//

Dim NextMonth As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +1, today))
Dim RptYear As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +1, today))

Dim NextMonth2 As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +2, today))
Dim RptYear2 As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +2, today))

Dim NextMonth3 As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +3, today))
Dim RptYear3 As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +3, today))

Dim NextMonth4 As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +4, today))
Dim RptYear4 As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +4, today))

Dim edvDates As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)

edvDates.dataView(edvDates.Row)("field1") =
DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString & "/1/" &
RptYear.ToString))
edvDates.dataView(edvDates.Row)("field2") =
DateAdd(DateInterval.Day, -1, DateValue(NextMonth2.ToString & "/1/" &
RptYear2.ToString))
edvDates.dataView(edvDates.Row)("field3") =
DateAdd(DateInterval.Day, -1, DateValue(NextMonth3.ToString & "/1/" &
RptYear3.ToString))
edvDates.dataView(edvDates.Row)("field4") =
DateAdd(DateInterval.Day, -1, DateValue(NextMonth4.ToString & "/1/" &
RptYear4.ToString))

End Sub

End Module


Ross


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Ross Hughes
Sent: Thursday, May 21, 2009 4:38 PM
To: vantage@yahoogroups.com
Subject: [Vantage] BAQ Report Dialog Boxes - Default Dates

Hi Everyone,



Does anyone know how to bind a calculated value to the option date controls
in a BAQ report dialog box?



I have generated the code for the default dates:

'-----------------------------------------------------

'Find next month and corresponding year

Dim NextMonth As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +1, today))

Dim RptYear As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +1, today))



'Find next month+1 and corresponding year

Dim NextMonth2 As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +2, today))

Dim RptYear2 As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +2, today))



'Subtract 1 day from the first day of selected months to get the months'
last day and show in message box

MessageBox.Show(DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString &
"/1/" & RptYear.ToString)))

MessageBox.Show(DateAdd(DateInterval.Day, -1, DateValue(NextMonth2.ToString
& "/1/" & RptYear2.ToString)))



'Attempt to present date calculation in BAQ option date controls

???? = DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString & "/1/" &
RptYear.ToString))

???? = DateAdd(DateInterval.Day, -1, DateValue(NextMonth2.ToString & "/1/" &
RptYear2.ToString))



'---------------------------------------------------



I can get the Message boxes to display correctly but I can't get them to
appear in the date controls. Both controls happened to be named the same
thing (dteActualDate) and the GUID provided is the same with the exception
of a '-1' after the second one.



I know that the dates come through in the XML under Option1 and Option2 but
I can't bind the existing control to this field due to data type variation.




I am trying to put this in the LOAD event of the form.



Thanks,

Ross





[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
1 Like
Hi Everyone,



Does anyone know how to bind a calculated value to the option date controls
in a BAQ report dialog box?



I have generated the code for the default dates:

'-----------------------------------------------------

'Find next month and corresponding year

Dim NextMonth As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +1, today))

Dim RptYear As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +1, today))



'Find next month+1 and corresponding year

Dim NextMonth2 As Integer = DatePart(DateInterval.Month,
DateAdd(DateInterval.Month, +2, today))

Dim RptYear2 As Integer = DatePart(DateInterval.Year,
DateAdd(DateInterval.Month, +2, today))



'Subtract 1 day from the first day of selected months to get the months'
last day and show in message box

MessageBox.Show(DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString &
"/1/" & RptYear.ToString)))

MessageBox.Show(DateAdd(DateInterval.Day, -1, DateValue(NextMonth2.ToString
& "/1/" & RptYear2.ToString)))



'Attempt to present date calculation in BAQ option date controls

???? = DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString & "/1/" &
RptYear.ToString))

???? = DateAdd(DateInterval.Day, -1, DateValue(NextMonth2.ToString & "/1/" &
RptYear2.ToString))



'---------------------------------------------------



I can get the Message boxes to display correctly but I can't get them to
appear in the date controls. Both controls happened to be named the same
thing (dteActualDate) and the GUID provided is the same with the exception
of a '-1' after the second one.



I know that the dates come through in the XML under Option1 and Option2 but
I can't bind the existing control to this field due to data type variation.




I am trying to put this in the LOAD event of the form.



Thanks,

Ross





[Non-text portions of this message have been removed]