tag:blogger.com,1999:blog-6718406939865222936.post1284980022185855734..comments2024-03-16T20:51:58.301+01:00Comments on the web thought: ASP: use FPDF to create a PDF with a dynamic tableMarco Del Cornohttp://www.blogger.com/profile/00863522198118005628noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-6718406939865222936.post-37082528913888436812012-12-20T13:01:33.977+01:002012-12-20T13:01:33.977+01:00It will be the fl variable. Print it on your PDF a...It will be the fl variable. Print it on your PDF and you will see that it will match the number of line/records. Marco Del Cornohttps://www.blogger.com/profile/00863522198118005628noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-29697800109849284002012-12-20T12:58:19.381+01:002012-12-20T12:58:19.381+01:00Yeah, i understand that but issue is how to determ...Yeah, i understand that but issue is how to determine the no. of lines in a multicell when it is displayed on pdf file.Ajay-Dhamahttps://www.blogger.com/profile/14391188793477058518noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-90746809670316983932012-12-20T09:02:34.463+01:002012-12-20T09:02:34.463+01:00Ajay,
The variable increments by one every time yo...Ajay,<br />The variable increments by one every time you add a new row. If you look at the end of the repeat region you will see that the index increments by 1. Marco Del Cornohttps://www.blogger.com/profile/00863522198118005628noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-83473346189761599992012-12-20T08:53:34.633+01:002012-12-20T08:53:34.633+01:00hi.. Marco
first of all a big thanks for yours go...hi.. Marco <br />first of all a big thanks for yours good work.<br />I have an issue with FL_index variable in your sample code, I do not understand how it will count the no. of lines in <br /><br />multicell.<br />i have 8 columns in my pdf and i am displaying records row by row in 8 columns using multicell and then a line <br />after every row and it is impossible to draw line untill i know the maximum no. of lines in any multicell of the<br />row because line has to be drawn below the multicell of max. no. of lines and multicells have no borders.<br />please help.Ajay-Dhamahttps://www.blogger.com/profile/14391188793477058518noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-58879202911117912962012-09-06T09:29:23.394+02:002012-09-06T09:29:23.394+02:00Hi Marco,
The script below works correct. I use t...Hi Marco,<br /><br />The script below works correct. I use the y height of the cell in this case 138 and substract this value from the image y parameter.<br /><br />I don't know of this the correct way but it works.<br /><br />So this script generate multiple A4 papersizes.Each paper contains 2 cells with an image.<br /><br />While ((Repeat1__numRows <> 0) AND (NOT rsMember.EOF))<br /><br />y = pdf.GetY()<br />pdf.SetXY 10,y<br /><br />pdf.Cell 190,138,""&(rsMember("name"))&"","1","1","R","L",True<br /><br />y = pdf.GetY()<br /><br />Set fs=Server.CreateObject("Scripting.FileSystemObject")<br /> If (fs.FileExists(Server.MapPath("/images/member/"&Replace((rsMember("name"))," ","_")&".jpg")))=True Then<br />pdf.Image "/images/member/"&Replace((rsMember("name"))," ","_")&".jpg",12,y-138,46,70<br /> Else<br />pdf.Image "/images/member/empty.jpg",12,y-126,46,70<br />End If<br /><br />Repeat1__index=Repeat1__index+1<br />Repeat1__numRows=Repeat1__numRows-1<br />rsMember.MoveNext()<br />WendStill_ASPnoreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-68748351354887133382012-09-06T07:57:47.736+02:002012-09-06T07:57:47.736+02:00Try to output the y variable and see how it goes.
...Try to output the y variable and see how it goes.<br />If you exactly know what's the height of the image (and I suppose you know it), try to increment the y variable by that height + margin. <br />Marco Del Cornohttps://www.blogger.com/profile/00863522198118005628noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-79911403299984001452012-09-05T09:19:49.938+02:002012-09-05T09:19:49.938+02:00Hi Marco,
I have a problem with repeat region.
I ...Hi Marco,<br /><br />I have a problem with repeat region.<br />I can't get the Cell and Image function simultaneously.<br /><br />Cell function start after two height of 130 at a new page<br />Image function continue. So I see a third image at the bottom of page 1.<br /><br />Do I something wrong with the y parameter.<br /><br />Set pdf=CreateJsObject("FPDF")<br />pdf.CreatePDF()<br />pdf.SetPath("../fpdf/")<br />pdf.Open()<br /><br />Dim y<br />y = 10<br /><br />pdf.AddPage()<br />pdf.SetFont "Arial","",12<br />pdf.setfillcolor 255,255,255<br />pdf.SetXY 10,y<br /><br />While ((Repeat1__numRows <> 0) AND (NOT rsMember.EOF))<br /><br />Set fs=Server.CreateObject("Scripting.FileSystemObject")<br /> If (fs.FileExists(Server.MapPath("/images/member/"&Replace((rsMember("name"))," ","_")&".jpg")))=True Then<br />pdf.Image "/images/member/"&Replace((rsMember("name"))," ","_")&".jpg",10,y,47,70<br /> Else<br />pdf.Image "/images/member/empty.jpg",10,y,47,70<br />End If<br /><br />pdf.Cell 190,130,""&(rsMember("name"))&"","1","1","R","L",True<br /><br />y = pdf.GetY()<br />pdf.SetXY 10,y<br /><br />Repeat1__index=Repeat1__index+1<br />Repeat1__numRows=Repeat1__numRows-1<br />rsMember.MoveNext()<br />Wend<br /><br />pdf.Close()Still_ASPnoreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-71992024743270828692011-07-20T11:20:50.442+02:002011-07-20T11:20:50.442+02:00Hey, I'm really glad the article has helped yo...Hey, I'm really glad the article has helped you in solving a problem! And a big thank you for letting me know about it. Hope it's sunny in Spain today, because here it's raining...Marco Del Cornohttps://www.blogger.com/profile/00863522198118005628noreply@blogger.comtag:blogger.com,1999:blog-6718406939865222936.post-56267045759788002022011-07-20T10:44:13.211+02:002011-07-20T10:44:13.211+02:00OMG!
I solved a hack with your code.
F...OMG! <br /> I solved a hack with your code.<br /> From Spain, thank you.Yo Mismonoreply@blogger.com