Filter Date Blank Title 106056

Thanks for all the help cooner. I figured out what I was missing and got it working. I used your message box idea to pop up a reminder box to not change the defaulted date box that contains the To Date for the report.

Thanks Again
Gene

--- In vantage@yahoogroups.com, "cooner_55421" <cooner_55421@...> wrote:
>
> Hi Gene,
>
> The example below seems to be working OK on the test system here.
>
> I threw in some messageboxes just in case.
> Also, I'm not sure it is necessary to specify anything for field2, it might default to todays date.
>
> Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As EventArgs)
> 'Add Event Handler Code
> Dim edvReportParam As EpiDataView = Type(oTrans.EpiDataViews("ReportParam"), EpiDataView)
> messagebox.show(today.adddays(- 1))
> edvReportParam.dataView(0)("field1") = today.adddays(- 1)
> 'edvReportParam.dataView(0)("field2") = DBNull.value
> messagebox.show(today.adddays(0))
> 'edvReportParam.dataView(0)("field2") = today.adddays(0)
>
> End Sub
>
> --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> >
> > If I switch the code to what you show below the report will run but still contains any activity done Today. What I am trying to do it get 1 of the 2 Options on the report to default to yesterday's date. What I have set up now is 2 Options Fields, - each tied to the PartTran.TranDate field. 1 is set for >= and the other is <=. This filters down the report to show only transatitions between these dates.
> >
> > The "field1" is not a field I can access in the BAQ to use as an Option Filed.
> >
> > Thank You
> > Gene
> >
> > --- In vantage@yahoogroups.com, "cooner_55421" <cooner_55421@> wrote:
> > >
> > > Hi Gene,
> > >
> > > Can you try "field1" instead of JobHead.Date01 ?
> > > And I am assuming that the DTE for JobHead.Date01 is Option 1 on the report form.
> > >
> > > This
> > > edvReportParam.dataView(0)("field1") = today.adddays(- 1)
> > > instead of this
> > > edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> > >
> > > .
> > >
> > >
> > >
> > > --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> > > >
> > > > I pulled the JobHead.Date01 into the BAQ for this report.
> > > > I then used it as one of the Option Fields to set Dates for the report.
> > > >
> > > > I put the following code on the Form Event Wizard Tab. Event Type is set to Load. It says that the Code compilies ok. Below is the Code and The Error I am Getting:
> > > >
> > > > Any Thoughts as to why this is not working?
> > > >
> > > > Thank You
> > > > Gene
> > > >
> > > > 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)
> > > > edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> > > > End Sub
> > > >
> > > > Error Detail
> > > > ============
> > > > Exception has been thrown by the target of an invocation.
> > > >
> > > >
> > > > Stack Trace
> > > > ===========
> > > > at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > > > at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > > > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
> > > > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> > > > at Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object sender, EventArgs e)
> > > >
> > > > Inner Exception
> > > > ===============
> > > > Cannot set JobHead.Date01.
> > > >
> > > > Inner Stack Trace
> > > > =================
> > > > at System.Data.DataRowView.set_Item(String property, Object value)
> > > > at Script.BAQReportForm_Load(Object sender, EventArgs args)
> > > >
> > >
> >
>
I have a BAQ written that checks assemblies issued to jobs. The report options have a to and from date using the Part.TransDate. When you run the report you have to select the required for the report. Both places default to the date you are running the report. This would be no problem except we are having trouble with the user's setting the "To Date" to 1 day back from the Date they run the report(basically we want them to use yesterday's date as the "To Date").

Does anyone know of a way to get the System Date - minus 1 to Default into the "To Date".

Thank You
Gene
You can customize the report form.

Here is an example that I use to set a date to DBNull.
You could try today -1 instead.

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)
edvReportParam.dataView(0)("field1") = DBNull.value
End Sub


--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> I have a BAQ written that checks assemblies issued to jobs. The report options have a to and from date using the Part.TransDate. When you run the report you have to select the required for the report. Both places default to the date you are running the report. This would be no problem except we are having trouble with the user's setting the "To Date" to 1 day back from the Date they run the report(basically we want them to use yesterday's date as the "To Date").
>
> Does anyone know of a way to get the System Date - minus 1 to Default into the "To Date".
>
> Thank You
> Gene
>
Correction, try this instead
edvReportParam.dataView(0)("field1") = today.adddays(- 1)

--- In vantage@yahoogroups.com, "cooner_55421" <cooner_55421@...> wrote:
>
> You can customize the report form.
>
> Here is an example that I use to set a date to DBNull.
> You could try today -1 instead.
>
> 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)
> edvReportParam.dataView(0)("field1") = DBNull.value
> End Sub
>
>
> --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> >
> > I have a BAQ written that checks assemblies issued to jobs. The report options have a to and from date using the Part.TransDate. When you run the report you have to select the required for the report. Both places default to the date you are running the report. This would be no problem except we are having trouble with the user's setting the "To Date" to 1 day back from the Date they run the report(basically we want them to use yesterday's date as the "To Date").
> >
> > Does anyone know of a way to get the System Date - minus 1 to Default into the "To Date".
> >
> > Thank You
> > Gene
> >
>
I pulled the JobHead.Date01 into the BAQ for this report.
I then used it as one of the Option Fields to set Dates for the report.

I put the following code on the Form Event Wizard Tab. Event Type is set to Load. It says that the Code compilies ok. Below is the Code and The Error I am Getting:

Any Thoughts as to why this is not working?

Thank You
Gene

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)
edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
End Sub

Error Detail
============
Exception has been thrown by the target of an invocation.


Stack Trace
===========
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object sender, EventArgs e)

Inner Exception
===============
Cannot set JobHead.Date01.

Inner Stack Trace
=================
at System.Data.DataRowView.set_Item(String property, Object value)
at Script.BAQReportForm_Load(Object sender, EventArgs args)
Hi Gene,

Can you try "field1" instead of JobHead.Date01 ?
And I am assuming that the DTE for JobHead.Date01 is Option 1 on the report form.

This
edvReportParam.dataView(0)("field1") = today.adddays(- 1)
instead of this
edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)

.



--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> I pulled the JobHead.Date01 into the BAQ for this report.
> I then used it as one of the Option Fields to set Dates for the report.
>
> I put the following code on the Form Event Wizard Tab. Event Type is set to Load. It says that the Code compilies ok. Below is the Code and The Error I am Getting:
>
> Any Thoughts as to why this is not working?
>
> Thank You
> Gene
>
> 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)
> edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> End Sub
>
> Error Detail
> ============
> Exception has been thrown by the target of an invocation.
>
>
> Stack Trace
> ===========
> at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> at Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object sender, EventArgs e)
>
> Inner Exception
> ===============
> Cannot set JobHead.Date01.
>
> Inner Stack Trace
> =================
> at System.Data.DataRowView.set_Item(String property, Object value)
> at Script.BAQReportForm_Load(Object sender, EventArgs args)
>
If I switch the code to what you show below the report will run but still contains any activity done Today. What I am trying to do it get 1 of the 2 Options on the report to default to yesterday's date. What I have set up now is 2 Options Fields, - each tied to the PartTran.TranDate field. 1 is set for >= and the other is <=. This filters down the report to show only transatitions between these dates.

The "field1" is not a field I can access in the BAQ to use as an Option Filed.

Thank You
Gene

--- In vantage@yahoogroups.com, "cooner_55421" <cooner_55421@...> wrote:
>
> Hi Gene,
>
> Can you try "field1" instead of JobHead.Date01 ?
> And I am assuming that the DTE for JobHead.Date01 is Option 1 on the report form.
>
> This
> edvReportParam.dataView(0)("field1") = today.adddays(- 1)
> instead of this
> edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
>
> .
>
>
>
> --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> >
> > I pulled the JobHead.Date01 into the BAQ for this report.
> > I then used it as one of the Option Fields to set Dates for the report.
> >
> > I put the following code on the Form Event Wizard Tab. Event Type is set to Load. It says that the Code compilies ok. Below is the Code and The Error I am Getting:
> >
> > Any Thoughts as to why this is not working?
> >
> > Thank You
> > Gene
> >
> > 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)
> > edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> > End Sub
> >
> > Error Detail
> > ============
> > Exception has been thrown by the target of an invocation.
> >
> >
> > Stack Trace
> > ===========
> > at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
> > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> > at Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object sender, EventArgs e)
> >
> > Inner Exception
> > ===============
> > Cannot set JobHead.Date01.
> >
> > Inner Stack Trace
> > =================
> > at System.Data.DataRowView.set_Item(String property, Object value)
> > at Script.BAQReportForm_Load(Object sender, EventArgs args)
> >
>
Hi Gene,

The example below seems to be working OK on the test system here.

I threw in some messageboxes just in case.
Also, I'm not sure it is necessary to specify anything for field2, it might default to todays date.

Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As EventArgs)
'Add Event Handler Code
Dim edvReportParam As EpiDataView = Type(oTrans.EpiDataViews("ReportParam"), EpiDataView)
messagebox.show(today.adddays(- 1))
edvReportParam.dataView(0)("field1") = today.adddays(- 1)
'edvReportParam.dataView(0)("field2") = DBNull.value
messagebox.show(today.adddays(0))
'edvReportParam.dataView(0)("field2") = today.adddays(0)

End Sub

--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> If I switch the code to what you show below the report will run but still contains any activity done Today. What I am trying to do it get 1 of the 2 Options on the report to default to yesterday's date. What I have set up now is 2 Options Fields, - each tied to the PartTran.TranDate field. 1 is set for >= and the other is <=. This filters down the report to show only transatitions between these dates.
>
> The "field1" is not a field I can access in the BAQ to use as an Option Filed.
>
> Thank You
> Gene
>
> --- In vantage@yahoogroups.com, "cooner_55421" <cooner_55421@> wrote:
> >
> > Hi Gene,
> >
> > Can you try "field1" instead of JobHead.Date01 ?
> > And I am assuming that the DTE for JobHead.Date01 is Option 1 on the report form.
> >
> > This
> > edvReportParam.dataView(0)("field1") = today.adddays(- 1)
> > instead of this
> > edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> >
> > .
> >
> >
> >
> > --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> > >
> > > I pulled the JobHead.Date01 into the BAQ for this report.
> > > I then used it as one of the Option Fields to set Dates for the report.
> > >
> > > I put the following code on the Form Event Wizard Tab. Event Type is set to Load. It says that the Code compilies ok. Below is the Code and The Error I am Getting:
> > >
> > > Any Thoughts as to why this is not working?
> > >
> > > Thank You
> > > Gene
> > >
> > > 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)
> > > edvReportParam.dataView(0)("JobHead.Date01") = today.adddays(- 1)
> > > End Sub
> > >
> > > Error Detail
> > > ============
> > > Exception has been thrown by the target of an invocation.
> > >
> > >
> > > Stack Trace
> > > ===========
> > > at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > > at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
> > > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
> > > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> > > at Epicor.Mfg.UI.Customization.CustomScriptManager.OnCustomCodeFormLoad(Object sender, EventArgs e)
> > >
> > > Inner Exception
> > > ===============
> > > Cannot set JobHead.Date01.
> > >
> > > Inner Stack Trace
> > > =================
> > > at System.Data.DataRowView.set_Item(String property, Object value)
> > > at Script.BAQReportForm_Load(Object sender, EventArgs args)
> > >
> >
>