Hi
I am running a membership system under version 9 platinum and have been successfully emailing pdf reports using action scripting with the pdf files encrypted and password protected.
I have now purchased the Report Mailer which is a definite help in speeding up the processing BUT there are no options to set pdf encryption within the package.
Now I am not the worlds greatest coder so I viewed the xbasic created by the action script and saw the following lines right at the start of the code setting the parameters for the pdf:
"
'Send a report, label, letter, form or browse layout as an attachment to an e-mail message. You can specify which records to send.
delete PrintOptions
DIM PrintOptions as P
With PrintOptions
.Concatenate = .f.
.HasWatermark = .f.
.MultilingualSupport = .f.
.EmbedFonts = .f.
.LinearizeForWeb = .f.
.Colors2GrayScale = .f.
.ConvertHyperlinks = .f.
.WatermarkType = "Text"
.WatermarkText = "D R A F T"
.WatermarkFontName = "Times New Roman"
.WatermarkFontSize = 172
.WatermarkRotation = 450
.WatermarkColorHex = "E8FED2"
.WatermarkHorizPos = 120
.WatermarkVertPos = -120
.WatermarkOnTop = .f.
.WatermarkPDF = ""
.Encrypt = .t.
.OwnerPassword = "xxxxxxxxxxx"
.UserPassword = "xxxxxxxx"
.CanPrint = .t.
.CanModifyDocument = .f.
.CanCopy = .t.
.CanAddNotes = .f.
.Use128BitKey = .f.
.JpegQuality = "Low"
End with
"
Now I did the same for the ReportMailer Action script and get this:
"
'Use ReportMailer to send out reports as attachments to e-mail messages.
query.filter = "Rosterprn = .t."
query.order = "recno()"
dim distribute_params as p
distribute_params.email_field = "Email1"
distribute_params.layout_name = "Game Roster 2008"
distribute_params.layout_type = "Report"
distribute_params.filter = query.filter
distribute_params.order = query.order
distribute_params.flags = ""
distribute_params.message ="=\"Will not bore you with the full content\""
distribute_params.subject = "=alltrim(Teamname)+\" \"+alltrim(Nickname)+ \" (\"+alltrim(Typecode)+\") Game Roster for \"+dmy(Var->vGamedate)"
distribute_params.create_log = .t.
distribute_params.logfile_name = "S:\Shared Databases\BAFA Central Database\layout_distribute_log.dbf"
distribute_params.file_type = "pdf"
distribute_params.cc_field = "Email2"
distribute_params.bcc_field = "Associations->Email"
distribute_params.profile_name = "Exchange Server - Chairman"
distribute_params.store_in_outbox = .t.
distribute_settings.return_receipt = .t.
distribute_params.update_table = .t.
distribute_params.update_field = "Rosterprn"
distribute_params.update_expression_success = ".f."
distribute_params.update_expression_failed = ".t."
'Now send the e-mails, passing in the settings contained in the 'distribute_params' dot variable
a5_layout_distribute(distribute_params)
"
Now I thought I would be clever and initially tried to copy and paste the PrintOptions into the other script but I cannot see how to call this information.
I tried to add a line
distribute_params.printoptions = printoptions
Did not work....
So then I tried to add all the Printoptions into separate lines eg:
distribute_params.Encrypt = .t.
Did not work....
Am I trying to achieve the unachievable?
Is it an option too far?
Is my knowledge of coding that bad that I am completely barking up the wrong tree or missing the blooming obvious?
Any help gratefully received.
G'night!
I am running a membership system under version 9 platinum and have been successfully emailing pdf reports using action scripting with the pdf files encrypted and password protected.
I have now purchased the Report Mailer which is a definite help in speeding up the processing BUT there are no options to set pdf encryption within the package.
Now I am not the worlds greatest coder so I viewed the xbasic created by the action script and saw the following lines right at the start of the code setting the parameters for the pdf:
"
'Send a report, label, letter, form or browse layout as an attachment to an e-mail message. You can specify which records to send.
delete PrintOptions
DIM PrintOptions as P
With PrintOptions
.Concatenate = .f.
.HasWatermark = .f.
.MultilingualSupport = .f.
.EmbedFonts = .f.
.LinearizeForWeb = .f.
.Colors2GrayScale = .f.
.ConvertHyperlinks = .f.
.WatermarkType = "Text"
.WatermarkText = "D R A F T"
.WatermarkFontName = "Times New Roman"
.WatermarkFontSize = 172
.WatermarkRotation = 450
.WatermarkColorHex = "E8FED2"
.WatermarkHorizPos = 120
.WatermarkVertPos = -120
.WatermarkOnTop = .f.
.WatermarkPDF = ""
.Encrypt = .t.
.OwnerPassword = "xxxxxxxxxxx"
.UserPassword = "xxxxxxxx"
.CanPrint = .t.
.CanModifyDocument = .f.
.CanCopy = .t.
.CanAddNotes = .f.
.Use128BitKey = .f.
.JpegQuality = "Low"
End with
"
Now I did the same for the ReportMailer Action script and get this:
"
'Use ReportMailer to send out reports as attachments to e-mail messages.
query.filter = "Rosterprn = .t."
query.order = "recno()"
dim distribute_params as p
distribute_params.email_field = "Email1"
distribute_params.layout_name = "Game Roster 2008"
distribute_params.layout_type = "Report"
distribute_params.filter = query.filter
distribute_params.order = query.order
distribute_params.flags = ""
distribute_params.message ="=\"Will not bore you with the full content\""
distribute_params.subject = "=alltrim(Teamname)+\" \"+alltrim(Nickname)+ \" (\"+alltrim(Typecode)+\") Game Roster for \"+dmy(Var->vGamedate)"
distribute_params.create_log = .t.
distribute_params.logfile_name = "S:\Shared Databases\BAFA Central Database\layout_distribute_log.dbf"
distribute_params.file_type = "pdf"
distribute_params.cc_field = "Email2"
distribute_params.bcc_field = "Associations->Email"
distribute_params.profile_name = "Exchange Server - Chairman"
distribute_params.store_in_outbox = .t.
distribute_settings.return_receipt = .t.
distribute_params.update_table = .t.
distribute_params.update_field = "Rosterprn"
distribute_params.update_expression_success = ".f."
distribute_params.update_expression_failed = ".t."
'Now send the e-mails, passing in the settings contained in the 'distribute_params' dot variable
a5_layout_distribute(distribute_params)
"
Now I thought I would be clever and initially tried to copy and paste the PrintOptions into the other script but I cannot see how to call this information.
I tried to add a line
distribute_params.printoptions = printoptions
Did not work....
So then I tried to add all the Printoptions into separate lines eg:
distribute_params.Encrypt = .t.
Did not work....
Am I trying to achieve the unachievable?
Is it an option too far?
Is my knowledge of coding that bad that I am completely barking up the wrong tree or missing the blooming obvious?
Any help gratefully received.
G'night!
Comment