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



How to write a script to not print Blank... Expand / Collapse
Author
Message
Posted 3/19/2008 1:25:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/20/2008 8:49:21 AM
Posts: 1, Visits: 5
"We have written a Workorder summary template that prints the Workorder
“Item Summary” and the Labor “Service Details” for each labor field
entered into a workorder. Many times there is multiple labor entries
made to keep close track of the time spent at a job site. Often our
personnel will enter details of the work performed at a site into only
one of the “Service Details” fields available to them. The remaining
labor “service details” fields are left blank. When the workorder
prints, each of the labor entries is printed along with a text field
containing the service details. If there were three labor fields
entered then three lines of time and service details is printed. If no
text was entered into a service details field a blank default area is
still printed. This takes up a lot of unused space on the page.

We want to write a script that looks at the labor “service details”
field and if it contains no text then we want to skip over the printing
of that field. Some of the sample templates do something similar to
this when they skip the printing of a parts summary when no parts are
used in a workorder. We tried modifying those scripts with no success.

Hope you can help."
Post #3895
Posted 3/19/2008 1:39:27 PM
AyaNova Sales & Support

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

Group: Administrators
Last Login: Today @ 7:45:59 AM
Posts: 1,866, Visits: 4,324
Hi

1. Please export your report template to file (see AyaNova 4 Help file on this http://www.ayanova.com/AyaNova4webHelp/exporting_a_report_template.htm)

2. Then zip up that file using WinZip and attach to a reply to this post.

Always attach a copy of the report template you have a question abour so that I can see it directly and answer directly for that particular report template.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #3896
Posted 3/20/2008 4:52:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/3/2008 5:23:08 AM
Posts: 3, Visits: 31
Attached to this post is a copy of the workorder report in question.

  Post Attachments 
Client Work Report_1.zip (2 views, 42.36 KB)
Post #3898
Posted 3/20/2008 8:55:25 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: Today @ 7:45:59 AM
Posts: 1,866, Visits: 4,324
Thnk you for posting the report template. I will download, import and take a look and post back.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #3901
Posted 3/20/2008 9:31:17 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: Today @ 7:45:59 AM
Posts: 1,866, Visits: 4,324
Hi again

Download CopyClientWorkReport_1.zip and import

Open the report template in the designer

View the OnBeforePrint script for Detail4 band (for labor)

You will see that it now has the script as follows:

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

//the first line converts the object Service Details to a string
//the second line checks to see if the string is empty or not
//if the string is empty (no Service Details are entered) than teh band is told not to display

   string s=Convert.ToString(DetailReport4.GetCurrentColumnValue("LT_WorkorderItemLabor_Label_ServiceDetails"));
                        if(string.IsNullOrEmpty(s))
                            {
                              e.Cancel=true;
                              return;
                            }
}

I tested it here with a workorder that had multiple labor records, and ensured that it did not display the records that had empty Service Details field.

Let me know you received.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #3902
Posted 3/20/2008 10:29:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/3/2008 5:23:08 AM
Posts: 3, Visits: 31
Joyce

Your script works great. Thank you.

Question? When we started working on this problem we went to the Devexpress web site and reviewed their online documentation for XtraReports. Even thought their online documentation is extensive I had trouble finding a method or function that would work for us in AyaNova.

What do you use as reference documentation when you are looking for methods, function, and properties?

Glenn
Post #3903
Posted 3/20/2008 10:40:13 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: Today @ 7:45:59 AM
Posts: 1,866, Visits: 4,324
Hi Glenn

DevExpress is the actual reporting component itself - whereas scripts etc are entered in C# language.

DevExpress provides details about their component only, but for C# scripts I usually perform a search online (i.e. Google) entering in text such as C# and whatever it is that I am trying to do - for example to get me started I entered the text  C# string empty in a Google search as I was looking for how to determine if a string is empty and read over the results to get ideas and examples, and than tested it to get successful results.

- Joyce

AyaNova Sales & Technical Support
http://www.ayanova.com
Post #3904
« 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 9:56am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 12 queries. Compression Disabled.