Change date value in BAQ report with code

Thanks Vic but this report has to be by calendar years and not fiscal years

Ephraim



On Mon, Jun 17, 2013 at 4:37 PM, Vic Drecchio
<vic.drecchio@...>wrote:

> **
>
>
> Alternatively, consider using InvcHead FiscalYear and Fiscal Period fields
> to accomplish this. I prefer to use FP & FY anyways as sometimes Invoice
> Dates may not be for the correct FY/FP.
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of
> Ephraim Feldman
> Sent: Monday, June 17, 2013 4:20 PM
> To: Vantage Yahoo Group
> Subject: Re: [Vantage] Change date value in BAQ report with code
>
> thanks Ted that gave me some start
>
> I actually wanted something more complicated I want the user to give a from
> and to date and then the report should print all records from begining of
> the year prior the to date.
>
> I put 2 date controls not bound to fields that are updating the character01
> and 02 of the reportparam and then update the field3 that actually filters
> the BAQ I hope all this makes sense but it works for me now
>
> So here is all my code
>
> Private Sub dteFromDate_Validated(ByVal sender As Object, ByVal args As
> System.EventArgs)
> ' ** Place Event Handling Code Here **
> Dim edvReportParam As EpiDataView =
> CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> edvReportParam.Dataview(edvReportParam.Row)("Character01")
> = dteFromDate.Text
> End Sub
>
> Private Sub dteToDate_Validated(ByVal sender As Object, ByVal args As
> System.EventArgs)
> ' ** Place Event Handling Code Here **
> Dim edvReportParam As EpiDataView =
> CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> edvReportParam.Dataview(edvReportParam.Row)("Character02")
> = dteToDate.Text
>
> Dim dte AS Date = dteToDate.Value.Date
> Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
> DatePart(DateInterval.Day,dte) + 1,DateAdd(DateInterval.Month, -
> DatePart(DateInterval.Month,dte) + 1,DateAdd(DateInterval.Year, -1, dte)))
> edvReportParam.Dataview(edvReportParam.Row)("field3") =
> RptBegin
> End Sub
>
> Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As
> EventArgs)
> ' Add Event Handler Code
> Dim edvReportParam As EpiDataView =
> CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> Dim dteFrom As Date = DateAdd(DateInterval.Day, -
> DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
> DatePart(DateInterval.Month,today) + 1,Today))
>
> dteFromDate.Value = dteFrom
> dteFromDate.Text = dteFrom.ToString()
> edvReportParam.Dataview(edvReportParam.Row)("Character01")
> = dteFrom.ToString("MM/dd/yyyy")
> dteToDate.Value = Today()
> dteToDate.Text = Today.ToString()
> edvReportParam.Dataview(edvReportParam.Row)("Character02")
> = Today.ToString("MM/dd/yyyy")
>
> Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
> DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
> DatePart(DateInterval.Month,today) + 1,DateAdd(DateInterval.Year, -1,
> today)))
> edvReportParam.Dataview(edvReportParam.Row)("field3") =
> RptBegin
>
> End Sub
> End Class
>
> On Mon, Jun 17, 2013 at 3:02 PM, Ted Koch <tkoch77@...> wrote:
>
> > **
>
> >
> >
> > Private Sub dteFrom_ValueChanged(sender As Object, e As
> > System.EventArgs) Handles dteFrom.ValueChanged
> > Dim dteFrom As DateTimePicker = DirectCast(sender, DateTimePicker)
> > Dim dte As Date = dteFrom.Value.Date
> > dteTo.Value = dte.AddMonths(1)
> > End Sub
> >
> > ________________________________
> > From: Ephraim Feldman <effgroups@...>
> > To: Vantage Yahoo Group <vantage@yahoogroups.com>
> > Sent: Monday, June 17, 2013 2:03 PM
> > Subject: [Vantage] Change date value in BAQ report with code
> >
> >
> >
> > Hi All
> >
> > I have a BAQ report with a from date and to date that will filter the
> > Invchead.invoiceDate.
> >
> > I want that when the user changes the "from date" then the "to date"
> > should automatically be set to a month later and then if the user
> > wants he can change it.
> >
> > How can i accomplish that with code?
> >
> > Ephraim
> >
> > [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
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
> [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
>
>
>


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

I have a BAQ report with a from date and to date that will filter the
Invchead.invoiceDate.

I want that when the user changes the "from date" then the "to date" should
automatically be set to a month later and then if the user wants he can
change it.

How can i accomplish that with code?

Ephraim


[Non-text portions of this message have been removed]
   Private Sub dteFrom_ValueChanged(sender As Object, e As System.EventArgs) Handles dteFrom.ValueChanged
       Dim dteFrom As DateTimePicker = DirectCast(sender, DateTimePicker)
       Dim dte As Date = dteFrom.Value.Date
       dteTo.Value = dte.AddMonths(1)
   End Sub



________________________________
From: Ephraim Feldman <effgroups@...>
To: Vantage Yahoo Group <vantage@yahoogroups.com>
Sent: Monday, June 17, 2013 2:03 PM
Subject: [Vantage] Change date value in BAQ report with code


Hi All

I have a BAQ report with a from date and to date that will filter the
Invchead.invoiceDate.

I want that when the user changes the "from date" then the "to date" should
automatically be set to a month later and then if the user wants he can
change it.

How can i accomplish that with code?

Ephraim


[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



[Non-text portions of this message have been removed]
thanks Ted that gave me some start

I actually wanted something more complicated
I want the user to give a from and to date and then the report should print
all records from begining of the year prior the to date.

I put 2 date controls not bound to fields that are updating the character01
and 02 of the reportparam and then update the field3 that actually filters
the BAQ
I hope all this makes sense but it works for me now



So here is all my code

Private Sub dteFromDate_Validated(ByVal sender As Object, ByVal args As
System.EventArgs)
' ** Place Event Handling Code Here **
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
edvReportParam.Dataview(edvReportParam.Row)("Character01")
= dteFromDate.Text
End Sub

Private Sub dteToDate_Validated(ByVal sender As Object, ByVal args As
System.EventArgs)
' ** Place Event Handling Code Here **
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
edvReportParam.Dataview(edvReportParam.Row)("Character02")
= dteToDate.Text

Dim dte AS Date = dteToDate.Value.Date
Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,dte) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,dte) + 1,DateAdd(DateInterval.Year, -1, dte)))
edvReportParam.Dataview(edvReportParam.Row)("field3") =
RptBegin
End Sub

Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As
EventArgs)
' Add Event Handler Code
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
Dim dteFrom As Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,today) + 1,Today))

dteFromDate.Value = dteFrom
dteFromDate.Text = dteFrom.ToString()
edvReportParam.Dataview(edvReportParam.Row)("Character01")
= dteFrom.ToString("MM/dd/yyyy")
dteToDate.Value = Today()
dteToDate.Text = Today.ToString()
edvReportParam.Dataview(edvReportParam.Row)("Character02")
= Today.ToString("MM/dd/yyyy")

Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,today) + 1,DateAdd(DateInterval.Year, -1,
today)))
edvReportParam.Dataview(edvReportParam.Row)("field3") =
RptBegin


End Sub
End Class





On Mon, Jun 17, 2013 at 3:02 PM, Ted Koch <tkoch77@...> wrote:

> **
>
>
> Private Sub dteFrom_ValueChanged(sender As Object, e As
> System.EventArgs) Handles dteFrom.ValueChanged
> Dim dteFrom As DateTimePicker = DirectCast(sender, DateTimePicker)
> Dim dte As Date = dteFrom.Value.Date
> dteTo.Value = dte.AddMonths(1)
> End Sub
>
> ________________________________
> From: Ephraim Feldman <effgroups@...>
> To: Vantage Yahoo Group <vantage@yahoogroups.com>
> Sent: Monday, June 17, 2013 2:03 PM
> Subject: [Vantage] Change date value in BAQ report with code
>
>
>
> Hi All
>
> I have a BAQ report with a from date and to date that will filter the
> Invchead.invoiceDate.
>
> I want that when the user changes the "from date" then the "to date" should
> automatically be set to a month later and then if the user wants he can
> change it.
>
> How can i accomplish that with code?
>
> Ephraim
>
> [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
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]
Alternatively, consider using InvcHead FiscalYear and Fiscal Period fields
to accomplish this. I prefer to use FP & FY anyways as sometimes Invoice
Dates may not be for the correct FY/FP.

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Ephraim Feldman
Sent: Monday, June 17, 2013 4:20 PM
To: Vantage Yahoo Group
Subject: Re: [Vantage] Change date value in BAQ report with code

thanks Ted that gave me some start

I actually wanted something more complicated I want the user to give a from
and to date and then the report should print all records from begining of
the year prior the to date.

I put 2 date controls not bound to fields that are updating the character01
and 02 of the reportparam and then update the field3 that actually filters
the BAQ I hope all this makes sense but it works for me now



So here is all my code

Private Sub dteFromDate_Validated(ByVal sender As Object, ByVal args As
System.EventArgs)
' ** Place Event Handling Code Here **
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
edvReportParam.Dataview(edvReportParam.Row)("Character01")
= dteFromDate.Text
End Sub

Private Sub dteToDate_Validated(ByVal sender As Object, ByVal args As
System.EventArgs)
' ** Place Event Handling Code Here **
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
edvReportParam.Dataview(edvReportParam.Row)("Character02")
= dteToDate.Text

Dim dte AS Date = dteToDate.Value.Date
Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,dte) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,dte) + 1,DateAdd(DateInterval.Year, -1, dte)))
edvReportParam.Dataview(edvReportParam.Row)("field3") =
RptBegin
End Sub

Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As
EventArgs)
' Add Event Handler Code
Dim edvReportParam As EpiDataView =
CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
Dim dteFrom As Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,today) + 1,Today))

dteFromDate.Value = dteFrom
dteFromDate.Text = dteFrom.ToString()
edvReportParam.Dataview(edvReportParam.Row)("Character01")
= dteFrom.ToString("MM/dd/yyyy")
dteToDate.Value = Today()
dteToDate.Text = Today.ToString()
edvReportParam.Dataview(edvReportParam.Row)("Character02")
= Today.ToString("MM/dd/yyyy")

Dim RptBegin AS Date = DateAdd(DateInterval.Day, -
DatePart(DateInterval.Day,today) + 1,DateAdd(DateInterval.Month, -
DatePart(DateInterval.Month,today) + 1,DateAdd(DateInterval.Year, -1,
today)))
edvReportParam.Dataview(edvReportParam.Row)("field3") =
RptBegin


End Sub
End Class





On Mon, Jun 17, 2013 at 3:02 PM, Ted Koch <tkoch77@...> wrote:

> **
>
>
> Private Sub dteFrom_ValueChanged(sender As Object, e As
> System.EventArgs) Handles dteFrom.ValueChanged
> Dim dteFrom As DateTimePicker = DirectCast(sender, DateTimePicker)
> Dim dte As Date = dteFrom.Value.Date
> dteTo.Value = dte.AddMonths(1)
> End Sub
>
> ________________________________
> From: Ephraim Feldman <effgroups@...>
> To: Vantage Yahoo Group <vantage@yahoogroups.com>
> Sent: Monday, June 17, 2013 2:03 PM
> Subject: [Vantage] Change date value in BAQ report with code
>
>
>
> Hi All
>
> I have a BAQ report with a from date and to date that will filter the
> Invchead.invoiceDate.
>
> I want that when the user changes the "from date" then the "to date"
> should automatically be set to a month later and then if the user
> wants he can change it.
>
> How can i accomplish that with code?
>
> Ephraim
>
> [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
>
> [Non-text portions of this message have been removed]
>
>
>


[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