View Full Version : Adding the critiria in Leban (report to pdf)


izen
04-16-2009, 06:46 AM
As I used the code from http://www.lebans.com/reporttopdf.htm to create PDF
It works good

But I have some question about it which is adding critiria in parameter of function ConvertReportToPDF.

'Public Function ConvertReportToPDF( _
'Optional RptName As String = "", _
'Optional SnapshotName As String = "", _
'Optional OutputPDFname As String = "", _
'Optional ShowSaveFileDialog As Boolean = False, _
'Optional StartPDFViewer As Boolean = True, _
'Optional CompressionLevel As Long = 150, _
'Optional PasswordOpen As String = "", _
'Optional PasswordOwner As String = "", _
'Optional PasswordRestrictions As Long = 0, _
'Optional PDFNoFontEmbedding as Long = 0, _
'Optional PDFUnicodeFlags As Long = 0 _
') As Boolean

' RptName is the name of a report contained within this MDB

can we add the critiria in "RptName"?

for example

"rIngredient", WhereCondition:=varWhere

varWhere is the critiria that we want to extract info

any suggestion ?

cheers,

pbaldy
04-16-2009, 07:18 AM
I use that code myself, but a limitation of it is that you can't use a wherecondition like that. You either need to add criteria to the report's source query or use a method like this:

http://www.granite.ab.ca/access/email/reporttomultiplerecipients.htm

If your varWhere was a public variable, you could use it with that method.

izen
04-16-2009, 08:44 AM
thank you for your answer pbaldy
However I dont understand that method

Could u pls explain abit more?

sitll open any suggestion

thank you

============================================

thanks guy problem was solved

I just put filter on the report before calling ConvertReportToPDF()
However I have to open the report that I want to convert before operating filter process
anyone has got problem like u can do like this

cheers

pbaldy
04-17-2009, 11:39 AM
Did you try the code in the link? It sets the filter dynamically.

izen
04-18-2009, 12:54 AM
thanks for your reply

well i dont understand that code

However method is also dynamiclly

cheers