Active Topics Memberlist Search Help | |
Register Login |
Programming | |
EXP Systems Forum : PDF reDirect : Programming |
Topic: Print Selected page of Access reports | |
Author | Message |
plunavat
Newbie Joined: 08 Sep 11 Location: India Posts: 2 |
Topic: Print Selected page of Access reports Posted: 08 Sep 11 at 2:31PM |
Hello,
I am using PDF reDirect to print reports to pdf from MS Access.
I need to print selected page of the multipage reports (eg- 2,3,6,8).
Can anyone help me to acheive this..
Also if possible let me know the VBA code for the same
Thanks & Regards,
Pranav
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 12 Sep 11 at 12:09AM |
Hi,
No, I do not know of any way to do what you are asking. Closest I got was to google your question and I found [this], but it sounds like they were not able to do it either. Best regards, |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
plunavat
Newbie Joined: 08 Sep 11 Location: India Posts: 2 |
Posted: 12 Sep 11 at 12:34AM |
Thanks Michel for your reply..
I think there is some confusion.
I want to print MS Access Reports. The data of the report is coming from database itself. This Report is multipage.
As of now when i print this report the complete report is printed and saved as pdf through PDF ReDirect. This is working perfectly. The VBA code for the same is,
code--- <Convert2Pdf MyDocumentName, MyBatchPrinter, MyOutputPath, MyOutputFilename, True, True>
I want to print selected page of the report say (first 2 page only). something like this is possible??
code--- <Convert2Pdf MyDocumentName(page 1, 2), MyBatchPrinter , MyOutputPath, MyOutputFilename, True, True>
Regards,
Pranav |
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 12 Sep 11 at 10:48PM |
Hi,
I checked the documentation of VBA Access, and there is a command called the "PrintOut" action which you can use to print a report, and includes the option to print a page range. This seems like a new command (I have Access 2010). Please search (in VBA for Access) for "PrintOut Macro Action", and it should give you the instructions you need. Here is a [link] with more info. All you need to do now is to modify my code to use this command. Modify the Function called "PrintOutputToBatchPrinter" like this (sample - you will need to use variables to set your page ranges in the future: '------------------------------------------------------------- ' Create the PDF by sending the Print Job to the Batch Printer '------------------------------------------------------------- ' Note: I received a report from someone who was having a problem ' printing his Access report. The first few records were being ' repeated/duplicated on the second page. Although I did not figure ' out why this problem occured, I was able to fix the problem by ' generating a "Preview" first before printing. (see below) DoCmd.OpenReport MyDocumentName, acViewPreview ' Generate a Preview First ' OLD COMMAND ' DoCmd.OpenReport MyDocumentName, acViewNormal ' Print the Report ' NEW COMMAND WITH PRINT RANGE 1 to 2 DoCmd.PrintOut acPages, 1, 2 Cheers! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
Goodwinm
Newbie Joined: 24 Dec 09 Posts: 16 |
Posted: 31 Oct 11 at 6:50AM |
Hi Plunavat,
I think there may be a roundabout way to do this - in Access - depending on the underlying database structure. I'm assuming the page selections are ad-hoc but I'm hoping there might be some way to exploit existing fields or create new ones that mirror the circumstances or your page choices. If that's the case, then it should be possible for you to reconfigure your Access report so that there is an added selection criteria reflecting those field(s) and which would generate a pop-up input request. & so the Report gets limited to just those pages you want printed. (The'll be numbered 1,2,3 though) just a thought |
|
IP Logged | |
Goodwinm
Newbie Joined: 24 Dec 09 Posts: 16 |
Posted: 31 Oct 11 at 6:57AM |
And even if its not possible to predict the circumstances that might give rise to future page choices, a special field, say like "Ad_Hoc_Printing", with values Yes/No, should do the trick. All you'd need is an Update Query routine that'll let you check/uncheck which records are to filtered in your Report.
M. |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |