Customizing a BAQ Report Form

I have already customized a drop down for one report option parameter. My question is how do I stop the print or print preview if they have not selected something in the dropdown. I can write the if statement but I am trying to figure out the event I have to capture validate and if need be abort the event. Any Ideas.

On Form Load you will need to disable the print buttons.

private void BAQReportForm_Load(object sender, EventArgs args)
{
	// Add Event Handler Code
	baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = false;
	baseToolbarsManager.Tools["PrintPreviewTool"].SharedProps.Enabled = false;
}

Then Enable/Disable once the value of the ReportParam field is changed.

private void edvReportParam_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
	// ** Argument Properties and Uses **
	// view.dataView[args.Row]["FieldName"]
	// args.Row, args.Column, args.Sender, args.NotifyType
	// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
	if (view.dataView[args.Row]["field1"] == null)
	{
		baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = false;
		baseToolbarsManager.Tools["PrintPreviewTool"].SharedProps.Enabled = false;
	}
	else
	{
		baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = true;
		baseToolbarsManager.Tools["PrintPreviewTool"].SharedProps.Enabled = true;
	}
}
1 Like

I tried this and I am having an issue getting the print button to behave. The print button won’t disable but I can remove it which means I have the right tool. Any Ideas what I can do to either add it in when the information is filled in or how to get it to disable. The print preview works fine. I am on 10.1 and the print button has the two options one for client and the other for server.

Try this…

private void BAQReportParam_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
	// ** Argument Properties and Uses **
	// args.Row["FieldName"]
	// args.Column, args.ProposedValue, args.Row
	// Add Event Handler Code
	switch (args.Column.ColumnName)
	{
		case "Field1":
			if (String.IsNullOrEmpty(args.Row["Field1"].ToString()))
			{
				baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = false;
				baseToolbarsManager.Tools["PrintPreviewTool"].SharedProps.Enabled = false;
			}
			else
			{
				baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = true;
				baseToolbarsManager.Tools["PrintPreviewTool"].SharedProps.Enabled = true;
			}
			break;
	}
}

There’s a good chance that in various bits of the standard code, that button is being re-enabled. I’ve ran across that before.

The easiest work around, hide the button, create your own that you can control and OnClick have it perform the click of the sys button.

1 Like

Good morning (epicor 10.2.300.12)
Has anyone experienced issues rolling out updates to these types of BAQR customizations with solution manager. Specifically - BAQR form changes not “taking” in the target DB.

We are having difficulty getting consistent results
usually when we tweak the BAQReport form customization on an existing item. It appears this may invoke some bad spirits :slight_smile:

Our SOP is to develop in one DB and use solution manager to roll the changes to TEST and then to LIVE.
but without directly deleting the existing BAQR and Customization from the target nothing seems to work.

Makes the roll out process 100% unreliable and inefficient.

Epicor tech hasn’t been able to provide an official statement regarding whether this is a supported feature . BMHATW