Reply
 
LinkBack Thread Tools Display Modes
Old 06-04-2009, 06:10 PM   #1 (permalink)
CrystalHacker
Guest
 
Posts: n/a
Default Add Salesperson Signature to Contact

The subject should say: "Add Salesperson Signature to Contract"

This looks like it would be easy to do based on the "RTF Include" code at
How to "Include" an RTF file in a report?

What would need to be changed to "include" a graphic?

It looks like this line would need to change.
ReportUtilities.SetRTFControl(rpt,"Detail1","txtSc opeofWork",filePath)

Is there a .SetImageControl?


-ch
  Reply With Quote
Old 06-05-2009, 08:02 AM   #2 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default Use SetImage Method

There is a method in ReportUtilities called SetImage, it will do what you want.

Syntax for that method is –

SetImage(ByVal report As ActiveReport3, ByVal sectionName As String, ByVal imageControlName As String, ByVal fullImagePath As String)

Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Old 06-17-2009, 06:06 PM   #3 (permalink)
CrystalHacker
Guest
 
Posts: n/a
Default Can't get signature to show.

I was able to get the SOW.RTF file "included" in the proposal and it works great. I am now trying to do the same thing with the a signature.
I attached the following files to the project:
Signature.gif
Signature.tif (I would prefer the transparent GIF but I was not sure what formats were supported

Inside GroupHeader1 I placed a "Picture" control named imgSignature.

I modified the SOW code, but I must be missing something.

Code:
Sub GroupHeader1_Format

	ReportUtilities.SetPresentedToAddress(rpt,"GroupHeader1","txtProjectAddress")

	ReportUtilities.SetPresentedByAddress(rpt,"GroupHeader1","txtCompanyAddress")

	ReportUtilities.SetCompanyLogo(rpt,"picLogo")

Private Const sigFileName As String = "Signature.tif"
		'get the Xml Data source
 	Dim xmlDS As DataDynamics.ActiveReports.DataSources.XMLDataSource = CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.XMLDataSource)
		
'	If xmlDs.EOF Then Return True  (This gave an error msg so I commented it out.)
	
	'Get the Project Folder Node List
    Dim projectFolderNodeIist As System.Xml.XmlNodeList = CType(xmlDS.Field("dtr:ProjectFolder", True), System.Xml.XmlNodeList)

     If projectFolderNodeIist.Count > 0 Then
        	
    	Dim filePath As String
    	
		''Combine the Project Folder path and the Rtf file
         filePath = System.IO.Path.Combine(projectFolderNodeIist(0).InnerText, sigFileName)
         
         'Load the RTF file
         ReportUtilities.SetImage(rpt,"GroupHeader1","imgSignature",filePath)
            
  	End If
	
End Sub
Any ideas?

-ch
  Reply With Quote
Old 06-17-2009, 08:00 PM   #4 (permalink)
CrystalHacker
Guest
 
Posts: n/a
Default

BTW... This code works perfectly when called via a subreport. I would like to do the same thing in a GroupHeader.

Code:
Private Const fileName As String = "SOW.RTF"
Private Const sigfileName As String = "Signature.gif"


Function ActiveReport_FetchData(ByVal EOF As Boolean) As Boolean

	'get the Xml Data source
 	Dim xmlDS As DataDynamics.ActiveReports.DataSources.XMLDataSource = CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.XMLDataSource)
		
	If xmlDs.EOF Then Return True
	
	'Get the Project Folder Node List
    Dim projectFolderNodeIist As System.Xml.XmlNodeList = CType(xmlDS.Field("dtr:ProjectFolder", True), System.Xml.XmlNodeList)

     If projectFolderNodeIist.Count > 0 Then
        	
    	Dim filePath As String
    	Dim sigfilePath As String
    	
		''Combine the Project Folder path and the Rtf file
         filePath = System.IO.Path.Combine(projectFolderNodeIist(0).InnerText, fileName)
         sigfilePath = System.IO.Path.Combine(projectFolderNodeIist(0).InnerText, sigfileName)
         
         'Load the RTF file
         ReportUtilities.SetRTFControl(rpt,"Detail1","txtSOW",filePath)
         
         'Load the image file
         ReportUtilities.SetImage(rpt,"Detail1","imgSignature",sigfilePath)
            
            
  	End If

	ActiveReport_FetchData = EOF
End Function
  Reply With Quote
Old 06-19-2009, 07:59 PM   #5 (permalink)
CrystalHacker
Guest
 
Posts: n/a
Default Getting the directory path to the Project Folder

A hint from nkarthick...

The reason the code in the posting is not working is that the Nodelist (what the report is bound to) is a flat set of XML nodes (probably items or proposal items). *The ProjectFolder node in the XML document is not part of that flat set of nodes the report is iterating over.

The easiest thing to do is this:*

In the designer, open the dataexplorer and drag the dtr:ProjectFolder node onto the report section. *This will create a textbox control bound to this field. *The datafield will be a relative XPath statement (like ../../../dtr:ProjectFolder)


Anyway, in script you should be able to use the ReportUtilities.GetTextBoxValue method to read the value

Dim myPath as string = ReportUtilities.GetTextBoxValue(rpt, {section name}, {controlname})

where*{section name} is the name of the section the control is in and {controlname} is the name of the textbox control

then replace this:
filePath = System.IO.Path.Combine(projectFolderNodeIist(0).In nerText, sigFileName)

with this:
filePath = System.IO.Path.Combine(myPath, sigFileName)

From there you should be good to go. *Obviously, you need to set the Visible property of the Textbox to false, etc, but that should get the value for you.
  Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
add product with accessories process grichards Bugs Section 3 10-31-2009 04:43 PM
How could I add new contact to a project? ogharib SDK 2 09-24-2009 04:27 PM
Add Folders Not Just Files David_Haddad Suggestions and Feature Requests 3 06-03-2009 02:39 AM
How to add a signature? CrystalHacker Reports and Reporting Center 0 04-29-2009 02:30 PM
Add Product Description to Add Package Window Kevin Mikelonis Suggestions and Feature Requests 0 06-02-2008 06:50 PM


All times are GMT. The time now is 08:41 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.