06-04-2009, 06:10 PM
|
#1 (permalink)
|
|
Guest
|
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
|
|
|
|
|
06-05-2009, 08:02 AM
|
#2 (permalink)
|
|
Senior Member
Join Date: May 2009
Location: Chennai, India
Posts: 157
|
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
|
|
|
|
06-17-2009, 06:06 PM
|
#3 (permalink)
|
|
Guest
|
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
|
|
|
|
|
06-17-2009, 08:00 PM
|
#4 (permalink)
|
|
Guest
|
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 |
|
|
|
|
|
06-19-2009, 07:59 PM
|
#5 (permalink)
|
|
Guest
|
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.
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 08:41 PM.
|
|