Menu

#9 Dynamic report creation problem

open
nobody
None
5
2014-08-21
2004-12-14
Anonymous
No

Hi,

I've been trying to use Report.net for a while now and I
have always the same problem: when I add 2 pictures in
my report it works if I declare two distinct RepImageMM
object. If I use a loop (in my case the image location
and layout is stored in a XML file) to add the
RepImageMM (as many as defined in the XML file) I
obtain a weird PDF which displays correctly the pictures,
but these pictures disappear as soon as I scrool into the
Document using Acrobat. Seems it is not able to add the
pictures dynamically or loses the object as soon as
opened. I have tried several coding techniques but
always get the same.

Coding is

Private Function LaunchFormat() as Report

Dim rp as new Root.Reports.Report()
Dim page as new Root.Reports.Page(rp)
page.rWidthMM = 210
page.rHeightMM = 297
Dim k as Integer

For k=0 to _picNode.ChildNodes().Count-1
Dim tmpPicNode as XMLNode = _picNode.ChildNodes
(k)
Dim strPath as String =
tmpPicNode.Attributes.GetNamedItem
("source_path").Value
Dim strCode as String =
tmpPicNode.Attributes.GetNamedItem("code").Value
Dim iRotate as Integer = CType
(tmpPicNode.Attributes.GetNamedItem
("rotate").Value,Integer)
Dim iX as Double = CType
(tmpPicNode.Attributes.GetNamedItem
("xposition").Value,Double)
Dim iY as Double = CType
(tmpPicNode.Attributes.GetNamedItem
("yposition").Value,Double)
Dim iScale as Double = CType
(tmpPicNode.Attributes.GetNamedItem
("ratio").Value,Double)

if strCode="PROD" then
strPath=strPath.Replace("?",_strCode)
end if

Dim tmpPic as new RepImageMM(strPath,
Double.NaN, Double.NaN)
if iRotate <> 0 then
tmpPic.RotateTransform(iRotate)
end if

if iScale <> 1 then
tmpPic.rHeightMM = Math.Round
(tmpPic.rHeightMM*iScale)
tmpPic.rWidthMM = Math.Round
(tmpPic.rWidthMM*iScale)
end if

page.AddMM(iX,iY,tmpPic)
Next
Return rp
exit Function
End Function

Discussion


Log in to post a comment.