Printing a Report from a Form in Access without a print preview or opening report? - forms

I have a button on a form that I want the user to be able to print a report without opening the report or viewing a print preview. This is my code so far:
DoCmd.OpenReport "DisplayUncompleteProjects", acNormal
DoCmd.RunCommand acCmdPrint
But my problem is that it is print both my form and the report. I just want to print the report. But I also don't want the user to leave the form page. (aka when they are done printing the report all they can see is still the form.)
Thanks.

Leave out the second line, which just prints the current object, and run only:
DoCmd.OpenReport "DisplayUncompleteProjects", acNormal

Related

Obtaining the Total Number of Bookmarks Within a Word Document

I am working on word page in Microsoft Office 2013, and I'm adding bookmarks to my page, I need to get a total count of how many bookmarks are on my page.
What method can be used to obtain the total number of bookmarks within the document?
You can do this in vba.
Open the VBE by simultaneously pressing AltF11. Enter this into a module, then run the code:
Sub countBookmarks()
MsgBox Bookmarks.Count
End Sub
This will bring up a MsgBox telling you the number of bookmarks you have.
If you so desire, you can assign this routine to a shortcut key to automatically run the code with the press of a couple of buttons.
Or you can just type AltF8 to bring up the list of macros you have stored in your document, which you can also run from there.
The code in the response marked as "The Answer" will not run in Word - it causes an error message.
Generally, to count the bookmarks in the main body of the currently active document, use:
Sub CountDocumentBookmarksInDocument()
MsgBox ActiveDocument.Bookmarks.Count
End Sub
If, as is also stated in the original question, you want to count the bookmarks on the current page:
Sub CountBookmarksOnPage()
ActiveDocument.Bookmarks("\page").Select
MsgBox Selection.Bookmarks.Count
End Sub

Crystal Reports Print Text on Last Page with no other information

We are trying to modify a crystal report (estimate template) to print some legalee jargon on the Last page of a crystal report. The last page would only have the text which we have in Group Footer 1b. Group Footer 1A has the totals of the document and should print after the details section. Currently the Page Header prints on the page with the Group Footer 1B text and we cannot seem to find a conditional format on how to exclude the page header from printing.
Can't use the report footer because we have multiple documents(estimates) which print at the same time.
I would put that information in the Report Footer. The report footer will only print once at the end of the report. If you want to make sure this information always has a page to itself, go into section expert, select Report Footer, then find the Paging tab (Not sure which version of CR you are using. I'm using CR2008. Layout might be different). Check "New Page Before". This will force a new page when it reaches the Report Footer.

Jasper Hiding Page Break on Specific Pages

Hi I want a page break that goes after each group except for the last group. Currently my page breaks separates all the groups nicely, but I would like the last group to be connected to the last page. The page break separates my last page footer, leaving a huge amount of space on the last page. Is there any way to do this?
I'm thinking of hiding the last page break but I'm unsure of how to do it.
Attempts to do a put into $P{REPORT_PARAMATERS_MAP} within the print when expression band of the summary band have been unsuccessful.
I tried placing the following into the 'print when expression' band of the summary band:
new Boolean($P{REPORT_PARAMETERS_MAP}.put("LastPageNumber",new Integer($V{PAGE_NUMBER}.intValue()-1)).equals("dummyPrintWhen"))
And using this on 'print when expression' of the break:
new Boolean(!$V{PAGE_NUMBER}.equals($P{REPORT_PARAMETERS_MAP}.get("LastPageNumber")))
But it's not working the way I want. It still gives me the last page footer all by itself on another page while still leaving a large amount of space on the previous page.
By taking out "!" on the break's 'print when expression', the breaks don't happen and I get my last page footer on a page all by itself as there is no more space on the previous page.
----------------------------EDIT--------------------------------
Printing $P{REPORT_PARAMETERS_MAP}.get("LastPageNumber") for every page
gives me null.
----------------------------EDIT--------------------------------
What am I doing wrong?
I'm currently using iReport 3.0.0
What if you use ?
new Boolean(new Boolean($V{PAGE_NUMBER}.equals($P{REPORT_PARAMETERS_MAP}.get("LastPageNumber")))==false)
I think what I'm trying to do might not be possible simply because the last page number can only be compiled at the end of the report, while the page breaks happen as the report is compiled.
I think this can be confirmed by nobody answering the question on this page: http://www.coderanch.com/t/579950/open-source/Jasper-report-store-total-number

How do i have the report footer ONLY appear on last page in Reporting Services?

I have a report footer that i want to appear on the last page only of my report. I have the option selected that says 'Print on Last Page' as True. I also have the option to print on first page as false. However, when i have an invoice say 4 pages long, the footer shows up on all the last three pages.
thank you for your suggestions.
You could try placing the content at the end of your report, making sure it is outside of any grouping object (list, matrix, table).
If the content is at the end of the report, it will always be on the last page and only the last page. No footer or special group is needed.
You can position it on the last page by leaving some empty space between the content you want at the end and the rest of the report. Check your report height and width settings.
Good luck.

Crystal Reports printing pauses between pages

When we print a crystal report using crystalReportViewer1.PrintReport(); the printers pause between pages and the client have to press a button in the printer to print the next page. If the client uses the report viewer print button it works fine.
It happens in these printers:
-HP CLJ 3600
-OKI C5450
I've seen that happen when the report is set up for a different paper size than the printer is expecting - ie: your report is setup for A4 and the printer contains 8 1/2 x 11.
In the end we make it work by calling the reportdocument print function instead of the reportviewer's reportDoc.PrintToPrinter(1, true, 1, 1000);
Dont know if Graham awnser is ok thought if someone confirms this i will mark as correct answer too...