Transact SQL :: Printing Report - Capture Actual Pages In A Duplex Printing Job
Aug 10, 2015
So I have been asked by our sustainability person to create report from our printing data that actually shows the number of pieces of paper used. This is easy enough for single-sided printing, but when printing in duplex the software does not take into account that 3 printing pages actually equates to 2 pieces of paper. I know this sounds simple, but say I have a print job record that looks like this:
This is a print jobs that if done correctly is actually 21 pages( duplex printing). If the job is say total_pages =5 I cant just divide by 2 because its actually using 3 pieces of paper ( yes they are wanting this data don't ask why). How can I adjust some sql to accurately depict 5 pages, front and back, as 3 pieces of paper?
I have been working on this problem for days. I have a report that is grouped and will be printed duplex (front and back). There is a page break after each group. I want to ensure that the start of a new group does not end up printed on the back side of an old group. For example:
Page 1 (printed on front side of paper): group 1 Page 2 (printed on back side of paper): more group 1 Page 3 (printed on front side of paper): more group 1 Page 4 (printed on on back side of paper): group 2 <--- This is a problem
I need:
Page 1 (front side): group 1 Page 2 (back side): more group 1 Page 3 (front side): more group 1 Page 4 (back side): <This Page Intentionally Left Blank> Page 5 (front side): group 2
Issues that I've run into include the fact that SSRS renders the entire body first, before rendering the header/footer. This prevents the body of the report from knowing which page it will end up on when it is rendered (and is also why you cannot reference Globals!PageNumber from the body).
The restriction above also prevents using a variable in custom code to know when to generate a page break. If you set this variable in the header/footer then the body will never see it as the entire body is rendered first and will therefore only see the initial state of the variable.
I have seen this issue posted in a number of places, but no one ever has a solution to this (except switching back to Crystal Reports). Have any MVPs ever addressed this issue? I am really hoping someone can offer a good solution or work-around.
I have a report that only has one page when previewed but when it's printed there are two pages. This is a problem because I get two printed pages to my report with "1 of 2 pages" on the first page and "2 of 2 pages" on the second but there is only data on the first page and the second has header and footer but no data.
Is there a way to force the report to fit everything on one page? Or some other setting I am missing?
We have a report that has been working fine for almost a year and just recently we found a bug that when we print, the 1st 3 pages each have a single line from the table header and then the details of the table print.
The report table does have 2 subreports in detail rows. We have diligently checked to make sure that the sizes fit in both the main report and the subreports and we know that the report version did not change.
After a little digging we discovered that we recently patched RS to be version 9.2.3042. When we run the report on another RS server that is running 9.00.1406.00, it works fine. Do you know if this could be the cause? If so, is there another patch that addresses the issue?
I have deployed a report that is configured for landscape printing. It does print in landscape, however, only the first seven columns appear on the first page and the other five columns appear on the next page. Is there a method, like in print preview setup in MS Excel, where we can scale down the print (like to 80%) so all columns appear on each page?
I have developed some report in Sql Server Reporting services my Page orientation is portrait that is report height and width are 8.5 and 11 respectively and margins are set to 0.3 in when it is printed the pages are printed more that actually viewed Pages.
Hi every one, I am facing problem in printing the reports from browser and also when i export it to pdf,the problem i am facing is blank pages are coming when report column getting the large amount of text around 2500 characters into column value. can any one help me in this issue?. if the report is getting acceptable amout of data it is printing in proper way i.e no balnk pages at all.i maintained all properties like margins+body size < page size.
I have a report that prints one record on a page. It also has four tables which print records from related tables. I pass it the ID of the master record an it works great. But I need to be able to print multiple master records, ie use the same form to print more than one record from the master table. I can pass more than one ID and change the Stored proc to return more than one master record, which I believe, with the addition of a page marker, will produce a multiple form report - but what about the tables which display multiple records for each ID? Does reporting Services understand the relationship between the tables and and restrict the tables on each page to the ID?David
I am having a problem with headers printing on separate pages. I have a report in RS 2000 that consists of 4 tables. Each table has several tables embedded within the table. The report has a header and each main table has two headers. The report layout is 11in. x 8.5in. with margins of 0.05in. The view space of the report is 10.2125in. Doing the math, I am withing the bounds of the paper; however, when I export to PDF, the report header and a legend table prints on the first page, the first table header prints on the second page, the second table header prints on the third page, the first data row prints on the fourth page and the rest of the table prints on the next page or several pages as needed. This repeats for the subsequent tables because I have the table property set to Insert page break after this table. I also have Repeat header rows on each page checked. I am at a loss as to why this continues to happen.
I ahve a report, that has 24 fields in the layout. When I tried to print the reprot, it prints BLANK pages, in between and at the start. I have confirmed that the width BODY of the report, < width of the report properties. It still prints blank pages.Pl advise.
I'm not sure what is going on but I created a table in the body of a report. I have set the RepeatOnNewPage property to be true. When I preview it the header is on all pages. Perfect! However when I print preview it or export to PDF the header is on Page 1 thru 6 it skips 7 and 8 and then prints on 9. This is happening on a few of my reports.
I must confess it has been a long time since I have done any SSRS reporting. I have the following SQL Statement (I will change it to a stored Procedure with parameters once I get the design done):
SELECT rc.wo_id, rc.process_id, rc.item_id, rc.lot_no AS full_lot_no, rc.oper_id, rc.seq_no, CAST(la.attr_value AS DECIMAL(12, 2)) AS weight,
[Code] ....
This gives me the data I want which looks like this:
The grouping is on the Rework ID. Any of the pieces can be put on any rework route. As you can see, there are 4 routes, but 5 pieces. What I need is for each rework ID to be printed on its own paper even if there is only 1 record for the route. So I would expect 4 pieces of paper, 3 with 1 record, the 4th with two pieces. Is there a setting in the Tablix or report that I can set, or is there an expression I can use?
="Page " + Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString()
When I run the report on the report manager, (through the site), the execution time, number of pages everything show properly. But when I print the report, the execution time and total pages is printing huge numbers, which are not in any way related the actual page numbers.
For example: When I run the report it shows the footer like below: Printed by xxxxxxxxx on 3/28/2008 1:59:01 PM Execution Time: 6 Seconds Page 1 of 213 When I print Printed by xxxxxxxxx on 3/28/2008 1:59:01 PM Execution Time: 47 Seconds Page 1 of 483
Does anyone know what is the solution to this problem is? I really appreciate your help,
Hi, I am having problems printing a new table we added to an existing report. When I preview the report in Visual Studio everything looks good. But when I click the print layout view button the "header" portion of the report shows on one page and the detail shows up on another. Has anyone seen this happen before?
i have created a report now i want to have the report print on one page instead of two pages which is doing now.how can i do that.i am using SSRS 2005. please help
I have a field on a Group Footer which is a Sum field based of an IIF statement.
Here it is.
=Sum(IIF(Fields!EXPR1.Value=2 and Fields!Type.Value=1,Fields!Quantity.Value,0))
If I do not use the AND, by by only checking on one field it works fine and it returns a result, however if I use the AND Operator I get the #Error when previewing the report.
Does anyone have any idea why this is happening. Any suggestion would help/
i have created a report now i want to have the report print on one page instead of two pages which is doing now.how can i do that.i am using SSRS 2005. please help
I have developed report(SSRS 2005) using Matrix control and Chart, on web in works good, but when user prints the report it cuts matrix and prints it on separate pages.
my requirement is to print every thing in a single page, no matter how much data i has. i tried landscape print (by changing width 11 and height to 8.5) but no result, does any one know the solution....?
I am running SSRS 2005, rendering reports locally using a report viewer. Rather than direct the viewer to an .rdlc file, I use an XMLDocument. A few of my reports have a large image in the background that needs to be invisible when the report prints. This was straightforward - I just use a report parameter and set the visible state of the image to the value of the parameter. The hard part is getting the report to print without an error.
Initially, I render the report with the following code:
End Sub This code works fine. I have hidden the print button on the report viewer, and to print, the user must press my button which runs the following code. Private Sub PrintReport()
Try _Param(0) = New Microsoft.Reporting.WinForms.ReportParameter("ImageVisible", "False") ShowReport()
ReportViewer1.PrintDialog()
Catch ex As Exception MsgBox(ex.ToString) End Try
End Sub Resetting the parameter and re-displaying the report works fine on its own. The PrintDialog method works fine on its own. When combined in the same Sub like this, I get the following error: "Operation is not valid due to the current state of the object". Does anyone know how I could get it to print without an error? I would be very grateful for any help.
I am rendering the report from remote server and I am displaying it. when I try to print the report from my application it is printin properly. but when I try to print it from IIS it is showing an error message that "No printers are Installed ". I did not specify any printer name in my application. How can I resolve this problem.
I have a report with pie and bar graphs, I have the paper size 16.54 x 11.69 for landsacpe, there are twelve graphs ,two placed side by side , and in the report manager, the appearence is perfect ,spread over six pages. I have Pagebreakatend True for all the graphs. The problem is with printing, on printing , the are tottaly misaligned,any tips are welcome
It appears to work fine on my end however on my clients end, whenever they try to print a report that displays perfectly within the report viewer to their printer by selecting the printer button in the report it never ends up printing.., however if they go into printer setup and change the page range to print from all pages to just maybe one page and then select the print button it seems to print fine..
The printer seems to receive the information as the light flashes but no page kick out when all pages is selected to print..
if I 'print' a MONEY value, or cast a MONEY variable to VARCHAR, it automatically rounds it to two decimal places. Maybe that's a built-in convenience, but I'd like to make it not do that.My workaround right now is to first cast my MONEY variabled to DECIMAL(30,4), and then cast the result to VARCHAR, but I'd like to avoid that step if possible.Consider the following
query:DECLARE @UnitCost MONEY SET @UnitCost = .0167 SELECT @UnitCost, CAST(@UnitCost AS VARCHAR(30)), CAST(CAST(@UnitCost AS DECIMAL(30, 4)) AS VARCHAR(30)) - - Results in: 0.0167, 0.02, 0.0167
My Requirement is to dirctly Print the SSRS Report without using Reportviewer. If anybody know How to Print Report without using Reportviewer, please let me know asap.
Hello Every one, we have reports, for that we are using Visual studio and report viewer. In Report viewer ,I Enabled print Option. While i tried to Print on HTML report from report viewer; I set Properties Landscae but the output is coming like Potrait. In my Rdl Interactive size Properties are width11 in and height 8.5 in why it is coming like Potrait size. can any one help me?
I have e-mails saved in a SQL database with all HTML formatting information. To remove all HTML formatting I craeted a function on the RS report:
Public Shared Function removeHtmlChar(ss) try Dim l as integer Dim i as integer Dim ch as string Dim x as integer Dim t as string t = "" l=len(ss) for i=1 to l ch=mid(ss,i,1) x=i if(ch="<") then x=i do while(mid(ss,x,1)<>">") x=x+1 loop else t=t & ch end if i=x next t = t.Replace("nbsp;"," ") removeHtmlChar = t catch removeHtmlChar = "" end try End Function
When I look at the report on the screen the report is showed correct. If I print or export the report it add a lot of line breaks in the e-mail text. Why does it not print it as it looks at the screen?
We have a report that prints correctly (in landscape) in the folder that is deployed to but the linked report in a different folder prints in portrait?
Is it possible to setup different font size when a user is browsing or printing a report?
I have a lot of data to print on a report and i need tu use a font size of 7pt which is fine for printing but when the user is looking at the report on the browser a font size of 7pt is a bit too small and the bold doesn't work.
I have report with a table, that generates rows to more than 1 page. When the user prints the report, each page should show the table header. Presently or by default , the table header is shown(printed) only on the first page.
I need to create address labels from report builder. I can create the same from report designer using list box and text boxes. But not able to create the same from report builder as it is supporting only one layout - table (Columnar) for table type. Can any one help me to place the filelds in row wise rather than column wise.
SUBREPORT (License info to the right) SHOULD PRINT TO RIGHT OF ADDRESS INFORMATION ON LEFT. LIKE THIS...
Name ABC-12345 Address line 1 DEF-12345 Address line 2 GH1-12345 City, State Zipcode
The data is from one table and looks like this. Both the main report and subreport use a shared data souce.
Name Address line 1 City State Zipcode License ------------- ------------------- ------------- --------- ---------- --------- Joe Schmoe 123 Maple Street Clearwater Florida 33777 ABC-12345 Joe Schmoe 123 Maple Street Clearwater Florida 33777 DEF-12345 Joe Schmoe 123 Maple Street Clearwater Florida 33777 GHI-12345
All lines are header lines. Subreport has been placed in top header line. IT IS PRINTING SIMILAR TO THIS BUT SHOULD PRINT AS FIRST STATED ABOVE...
Name ABC-12345 DEF-12345 GH1-12345 Address line 1 Address line 2 City, State Zipcode
ISSUE: I would like the subreport to PRINT ALONG WITH the address information to its left. In Crystal Report a subreport could "Underlay Following Sections" - a wonderful feature Microsoft maybe should have copied. Is there a way to duplicate "underlay" behavior in SQL Reporting ? Thanks.
UPDATE: Coworker found workaround. Can concatenate Name, Adress line 1, Address line 2, City, State and Zipcode into one field. Would still like to know a more straightforward way.
Hello, I am trying to get a SSRS 2005 report to print from my Visual Studio 2005 C++ application without using the ReportViewer to preview it first. What I have done is created a dll that I call into when I want to access a certain report and print it. While searching around on the internet I found an MSDN article about printing a report without previewing and it had an example in C# code. So I used that as a guide for my C++ code but I am still having problems with rendering the report properly so it can be printed. When I try to render a report using the "Image" format, my streamid string is empty but the byte array that the render routine returns is not. Here is the code I am using, what could be the problem here?
Note: m_Streams is define elsewhere as array<String^>^ m_Streams = gcnew array<String^>(10);