AyaNova service management & work order software
AyaNova Support Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



trying to get fields to not print when... Expand / Collapse
Author
Message
Posted 1/9/2009 7:23:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/20/2009 1:04:46 AM
Posts: 2, Visits: 9
i am happy with the template i have created, except that it does not seem to want to ommit certain report items when they have no data, i have tried deselecting the print on empty data source option but no joy, please help, see file attatched, the report items in question are as follows: itemrepair, itemrepairshipping, and loan

any help would be greatly appreciated

rich

  Post Attachments 
Evolution NEW NIGHTCLUB Detailed Service Workorder with Grand Total DO NOT EDIT TEMPLATE.zip (5 views, 136.06 KB)

Post #4477
Posted 1/9/2009 10:32:32 AM
AyaNova Sales & Support

AyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & SupportAyaNova Sales & Support

Group: Administrators
Last Login: 2 days ago @ 7:34:22 AM
Posts: 2,190, Visits: 5,029
Hi Rich

The other bands have specific scripts that tell the report engine not to print those if no data.

You need to apply OnBeforePrint scripts to each band type (different script if a GroupHeader or GroupFooter, than if a Detail band) along with referencing its main DetailReport band name, if you do not want it to print if no data just like the other bands already have.

For example:

Open your report template in the report designer

Click on the GroupHeader3 band to select it (the band right under DetailReportItemMiscExpense)

Expand the Scripts properites in the Properties band for this band

See that there is a OnBeforePrint script for this band - you will see that the script for this GroupHeader3 band says:

private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{

   //*************************
   //Don't print band if there is no data:

   object o=DetailReportItemMiscExpense.GetCurrentColumnValue("ID");
                        if(o==null)
                            {
                              e.Cancel=true;
                              return;
                            }

                            System.Guid g=(System.Guid)o;
                            if(g==Guid.Empty)
    e.Cancel=true;//cancel this print event
   //**************************

}

If you click on the Detail6 band, and check its Scripts property, you will see it also has a OnBeforePrintScript slightly different:

private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{

   //*************************
   //Don't print band if there is no data:
   //Get the id value of the record
   System.Guid g=(System.Guid)DetailReportItemMiscExpense.GetCurrentColumnValue("ID");
   
   //See if it's empty:
   if(g==Guid.Empty)
    e.Cancel=true;//cancel this print event
   //**************************
   

}

And if you click on the GroupFooter4 band  and check its Script properties you will see it too also has a OnBeforePrint script similar to the GroupHeader3 band

private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
   //*************************
   //Don't print band if there is no data:

   object o=DetailReportItemMiscExpense.GetCurrentColumnValue("ID");
                        if(o==null)
                            {
                              e.Cancel=true;
                              return;
                            }

                            System.Guid g=(System.Guid)o;
                            if(g==Guid.Empty)
    e.Cancel=true;//cancel this print event
   //**************************
}

And if you check the other bands for labor, parts, etc, you will also see that they too have OnBeforePrint scripts specifically referencing their DetailReport band 's groupheader, detail and groupfooter bands.

Therefore what you need to do is enter in OnBeforeScripts for those bands for them not to print.

BUT NOTE THE FOLLOWING

Before you can set the ONBeforePrint scripts for the loan related bands, the DetailReport1 band for your loan bands is NOT actually referencing the specific WorkorderItemWorkorderItemLoan DataMember which is where it can get the loans data from. Right now it is not referencing anything, so you need to do that first.

  • click to select the DetailReport1 band
  • View its Properties
  • Drop down the DataMember field and select WorkorderItemWorkorderItemLoan by expanding the WorkorderHeader, than its WorkorderHeaderWorkorderItem, than selecting the WorkorderItemWorkorderItemLoan
  • (note this would have been done automatically for you if you had set up the Detailreport band as outlined in the tutorial on creating detailed report templates)

Do note if you attempt to do this for the Outside service related bands, you will see that there is not a WorkorderItemWorkorderItemOutsideService DataMember. This is because Outside Service related fields are part of the WorkorderHeaderWorkorderItem DataMember. And because of this, if you try to use the OnBeforePrint scripts for these, if there is any data in the Workorder Item itself, those fields will still print even if those specific fields outside service fields are 0.  It may be possible instead to create specific custom scripts created specifically for this report to check if for example if there is no vendor selected in Sent To, to not print.

Please note that report design support is outside the realm of our free support for AyaNova. We have provided numerous support topics and solutions on this forum at no charge, but do note that this is at our discretion.

If you would like additional support with this report template, I would be happy to send you a quote and link for payment.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #4479
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: AyaNova Sales & Support

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 2:24am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.047. 10 queries. Compression Disabled.