|
|
|
Forum 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."
|
|
|
|
|
AyaNova Sales & Support
      
Group: Administrators
Last Login: 2 days ago @ 7:58:18 AM
Posts: 1,851,
Visits: 4,300
|
|
|
|
|
|
Forum 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.
|
|
|
|
|
AyaNova Sales & Support
      
Group: Administrators
Last Login: 2 days ago @ 7:58:18 AM
Posts: 1,851,
Visits: 4,300
|
|
| 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
|
|
|
|
|
AyaNova Sales & Support
      
Group: Administrators
Last Login: 2 days ago @ 7:58:18 AM
Posts: 1,851,
Visits: 4,300
|
|
| 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
|
|
|
|
|
Forum 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
|
|
|
|
|
AyaNova Sales & Support
      
Group: Administrators
Last Login: 2 days ago @ 7:58:18 AM
Posts: 1,851,
Visits: 4,300
|
|
| 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
|
|
|
|