why my page number in SSRS dashboard doesnt displays in the right corner of each page? - sql

My dashboard consist of 10 sub-reports. And some of those sub-reports are several pages.In a page footer of a dashboard I entered expression in a textbox:
="Page " & Globals!OverallPageNumber & " of " & Globals!OverallTotalPages
which gives me the page number, but how can I move this to the right corner?
As you can see on a below picture the expression already further right than even sub-report itself. What else can I do?
This is my report properties for the Dashboard:

It looks like the table you have is a Matrix with Column grouping. The grouping is expanding and pushing the width but unfortunately, that doesn't push the footer out.
Since you can't make the position dynamic, you'll have to figure out where the sub report page ends and extend the main report's width to fit the page number.
It looks like the first column is 4 inches wide and the matrix columns are 2 inches wide. I would put the text box at 15 inches and make it 1 inch wide.

Related

Exporting the SSRS Report in pdf format is having blank page issues

In SSRS Report 2016, I have 2 tablixes. The 2nd tablix contains only 4 columns.
When I preview the report, It comes perfectly in one page but when I export the report in PDF format or click on the Print Layout button in the report, the whole 2nd table/tablix moves to the next page.
In my case, the sum (Body Width + Left margin + Right margin) is less than the resulting page width. I set keep_together property to false but the 2nd table keeps rendering on the new page. If the 2nd table has less content then it displays below the first table on the same page and if the content is a little bit large then the whole table shifted to the next page and if the content is too big then it starts displays on the 1st page below the first table on the same page and continues on next pages with the remaining content. All the thing is happening when I am exporting report in PDF format, not on report preview.
Any solution for this?
Do you have dynamic col grouping or hidden textboxes ? in this case you need to make sure that when all the col visible on the reports it must have sum of width and margins less than the reports width.
Cross check the report width from properties window sometimes it contains white spaces because of which this happens.
Check whether you have added a page break after the tablix. If you did, and if there is nothing else to show after the tablix, then it will display blank on the next page.
Another possible reason that may bring blank page is that there exists large white space between tablix and page footer.
Please try these points once. Hope it resolve your issue.

SSRS Report Adding Extra Pages When Converting to PDF

I have an SSRS report that has a master page with a tablix that has 1 cell, and in that cell is a subreport. To be safe I made this page 1in x 1in.
The subreport is linked to a report that is 8.5in x 11in. There is nothing on this report but a text box with a page number. The textbox cangrow property is false. The orientation for the report is set to portrait and paper size is letter.
Container consume whitespace is set to true for both, and neither page has margins, headers, footers, or padding.
The dataset for the tablix returns 1825 rows, but when the report is converted to PDF it is creating 2362 pages, and the page number is pushed progressively further down the page until blank pages appear.
Any idea how I make it 1825 8.5in x 11in pages?
The problem was that I was also defining the height/width in the query string when calling the report, which apparently caused problems. I changed:
http://test/ReportServer?/Folder/Reports/REP/REP_Master&rs:Command=Render&rs:Format=PDF&rc:Parameters=Collapsed&rc:PageHeight=8.5in&rc:PageWidth=11in&P_DB_NAME=TEST&P_BATCH_ID=9999999
To:
http://test/ReportServer?/Folder/Reports/REP/REP_Master&rs:Command=Render&rs:Format=PDF&rc:Parameters=Collapsed&P_DB_NAME=TEST&P_BATCH_ID=999999
and it works.

Word VBA to return the height and width of a preselected image

I have a Word macro that changes the orientation and page size of an individual page to accommodate the image placed on the selected page. My existing macro code does the page and footer resizing correctly (footers are based on our existing footer styles), but I'd like to enhance the code to display the height and width of the selected image before the userform appears to help guide the user's page size choice.
The user could get that information by right-clicking the image, choosing "Picture...", and selecting the "Size" tab in the "Format Object" window, but I am trying to have the height/width displayed as part of the macro instead of asking the user to follow those steps.
Editors in my department sometimes encounter documents in which an image has been placed on a page that is not wide enough to accommodate the entire image, resulting in part of the image being "cut off." My plan has been to have the user select the image on the Word page, then run the macro; the image's height and width (in inches, ideally) should be displayed prior to the user to selecting the optimal page size.
I've tried working with Selection.ShapeRange or Selection.InlineShapes, but I haven't yet been able to get the current height and width of the selected image. Any help will be greatly appreciated.
Thank you,
KRS
Here's how I opted to handle this:
My macro was designed to start with the user selecting an inline shape on the Word page. With that selection, I start by setting variables for the selection's width and height in points, convert to inches, and display the results in a MsgBox:
myHeightPoints = .Height
myWidthPoints = .Width
`Convert the previously established variable to inches`
`Dim myHeightInches As Double
Dim myWidthInches As Double
myHeightInches = myHeightPoints / Application.InchesToPoints(1)
myWidthInches = myWidthPoints / Application.InchesToPoints(1)
`Trim the result to 2 decimal places`
Dim myHeightDisplay
Dim myWidthDisplay
myHeightDisplay = Format(myHeightInches, "#.00")
myWidthDisplay = Format(myWidthInches, "#.00")
`Display the result`
MsgBox ("The selected image is " & myHeightDisplay & " H X " & myWidthDisplay
& " W" & Chr(13) & "Choose a page size that accomodates the figure and its caption.")

Match two trellis pages between two different graphs

I want to have on the same page a pie chart and a bar chart, with trellis pages.
They both have 5 columns as trellis, so 5 different pages that you can visualize by scrolling down.
However, I would like to display the same pages at the same time for both graphs. For instance, let's imagine I'm on the pie chart, I scroll down one page - and so my pie chart is on page2 - I want my bar chart to automatically go to page 2 as well
I tried to use markings but although it links a bit the two graphs, it doesn't change the trellis pages automatically
Does anyone know how to do this ?
as #scsimon mentions, there's no native feature (nor API method, AFAIK) for this using a trellis. however, you can create a Property Control (I'd use a dropdown) in a Text Area, then use the same Document Property to your chart in a Limit By expression.
little more detail, assuming a data table like this:
A B CATEGORY
1 2 red
3 4 red
5 6 green
7 8 green
9 10 blue
11 12 blue
add a Text Area to the page and edit its contents
add a Property Control
click New to create a Document Property, give it a type String and a name category
change Set property value through to Unique values in column and choose the "category" column and click OK
save the Text Area contents
in your Pie Chart's Properties dialog, go to the Data page and look for Limit data using expression. click Edit
set the expression to: [CATEGORY] = "${category}" (don't forget the quotes or the Document Property won't be treated as a string and you'll get an error)
repeat steps 6 & 7 for your other chart
As #scsimon mentioned in the comments, it seems to be impossible. I found a way to have a similar representation though without using trellis visualization, by using text arena
I created a list box that contains the 5 columns I want to visualize, and then I select this list box as the vertical axis variable of the bar chart and the sector size of the pie chart
Then, by clicking on my list box, I can have a synchronized Pie chart and Bar chart (a bit different from what I expected but it also has some advantages like a multiple scale since a new graph is generated independently of the other variables)

Empty pages in RDLC-Report

I have a rdlc report that conains a tablix, nothing other. The Tablix expands in horizontal direction to show days and in the vertical direction to show groups.
The tablix works as expected, as long as I set the width of the content area equal to the width of the tablix.
If I expand the content size to its fixed size (approximately PageWidth-PageBorders) and run the report, every second page is an empty page.
However the tablix only uses one page. Every odd page is absolutely empty. It seems that the tablix adds its horizontal expansion to the currently definied content width and calculates then the overflow.
The reportviewer Version is 3 (2010 Redistributable)
Does someone have a solution for this odd behaviour?
Update
If I export the report to excel, I see that there is on the right site of the tablix a column that is exactly as long as the generated items for the days. It seems realy to be a bug or a feature I don't see how to deactivate.
I also have tried to create the same construction from a table, and it resulted in the same problem, what not is astonishing, because the table is internally also a tablix.
Update 1
If I set the property "ConsumeContainerWhitespace" of the report to true, the above test version works. But if I place then other elements in the "white" area, the effect reocurrs.
Setting the page-property ConsumeContainerWhitespace=true (in the properties dialog, F4) has helped. However it was anyhow tricky to build the report correct. At the begining it worked only if I added all extra content to the page-header and footer. But this was not acceptable. After a lot of trying, I succeed in making the report as desired. However I don't really understand the logic behind.
I have in mind that I already have done such reports (growing in both directions, horizontally and vertically together) without any problems and I don't know what is difference to this report here. For this report, it's definitively reproducable that the ConsumeContainerWhitespace-property makes the difference. But why this never happens to me for similar reports I have done, I don't know. Also I don't know why I had first to circle around before the layout-engine accepted my design.
The best way to solved this problem is, for example for an A4 page where
Width=21 cm and Height=29.7 cm
Now Margin Left=1 cm and Right=1 cm so you are having a usable width of 19 cm.
When you have understand this basic calculation that means your problem is solved. You can set up the report page size properties by right clicking on the report property => pagesetup.
I was working with an RDLC report that was printing an extra blank page. I tried all the usual tricks, and everything I could think of, until I realized the problem was caused by an extra amount of visible whitespace in the right margin area of the report. One of the objects in the report (a "Rectangle") was a single pixel or two too wide, and this prevented resizing the visible space of the report. Once I removed all the extra width, the report started printing with the expected number of pages.
Visual Studio 2017 (15.7.5) + Microsoft Rdlc Report Designer extension (v14.2)
I had a similar problem, I solved it this way
For instance for width, the following equation should be satisfied
PageSize >= LeftMargin + BodySize + RightMargin
where to find BodySize?
Press F4 -> CLick somewhere inside the report -> you will find body property(look at size property, take the width value)
Where to find report PageSize?
click somewhere outside the report -> you will find report property ( look at PageSize (take its width value), and margins (Left, right, ..), take left and right margin values)
take values from these properties, and check if they meet
PageSize >= LeftMargin + BodySize + RightMargin
Check the "body" size, try to make it as wide and height as your real paper size but reduce only the margins.
There is a confusion there on the page design. Developers would think the report being designed is WYSIWYG, but actually it's NOT!! Microsoft reportviewer will take your designed page as the content!! and append the margins defined on the outside of your page, and turn out that your page can never fit in to one page!!
So, when you design a new report, focus on the content area, the client area, including your headers and footers, and allow margins to be appended on your outer border.
the solution is simple ConsumeContainerWhiteSpace=True (you find this in the property window for "report") you set the paper size in the main menu/ report/report properties for example to "A4" and then you check that paper size is larger then body + header + footer + margins.
I was having the same issue until I played with the report body's height and width. :)
Please select "Report" in the object selector at the top of the window.
and make the ConsumeContainerWhiteSpace = true
if the also same problem persist then, your rdlc report size should be less than your report body.!
I have meet this problem recently.
The root cause may be:
your report's body has some blank upside report Footer or somewhere else.
The solution is :
1, click the report body
2, go to the property window, you will see the body size property
3, check the body size, you may find a strange number like 9.6654in,1.5625in.
that means you have some blank upside the Footer, modify the height or width size till there is no blank you can see.
Go to Property F4
Select Body
Write width and height to 1cm
Visual studio will overwrite to the smallest Body possible
Done.
You need set report width property to actual print page width. In my case 6 inches helped.
You need to make sure your RDLC Report have :
ConsumeContainerWhiteSpace = true (open by click F4)
Report Body Size <= Page Size+margin Size. (open by Ctrl + Alt + D)
Page Footer may cause the problem too. So if you have one, it's better to place it as near as possible to the main content. In this case you don't need to set the Body.Height property.
My 4x2 inch label was printing 3 extra pages for a one page report.
To fix it, I reduced the Body.Size attribute to be same or smaller than the Report.PageSize minus the summed respective Report.Margins.
Try this one,
Just make sure that all Data the needed is in the report,
Then Select the Table or the Matrix and make it squeeze to the left and if needed to the Top Left Corner until your white Page Problem is Done.
But make sure that the cells are squeezed in the right manner, Be gentle (I hope you got it !!)
Ok, Bye
Or you can just graphically resize your report design, to the exact bottom of the last report control or label.
Or add a footer section to create some space.
I thought this important enough to put here, especially since every day more of the critical information we need to do our jobs keeps disappearing:
From response to The "Every Other Page Is Blank" Feature
Many Reporting Services users ask this question:
"I'm rendering to a physical page format (PDF, Image, Print) and for
some reason a blank page gets inserted between all of the other pages
in the report. Thank you, Reporting Services, for the free pages.
It's a charming feature, but paper ain't free and I'm getting paper
cuts pulling out every other blank page after it's printed. How do I
make it stop?!"
To which I reply:
This is almost always caused by the Body of your report being too wide
for your page. Make sure that the Width of the Body is less than the
physical page size, less the margins. For those of you who are into
the math thing, make sure that:
Body Width <= Page Width - (Left Margin + Right Margin)
For physical page renderers, it's important to keep in mind the
concept of Usable Area. The Usable Area is the amount of space left
on a page for your report to be drawn after reserving space for
margins, headers and footers, and column spacing (for multi-column
reports).
Horizontal usable area:
X = Page.Width - (Left Margin + Right Margin + Column Spacing)
Vertical usable area:
Y = Page.Height - (Top Margin + Bottom Margin + Header Height + Footer
Height)
Any time objects on your report (including the Body itself) extend
past the usable area either because they are defined like that or
because they grow at runtime, the physical page renderers have no
choice but to break onto a new page.
Make sure Body size is cm , not in(inch)
For me when I increase the width for pagesize report from 21 to 23 cm , It was not generating extra empty page.
Because of few elements total size of my report's element was greater than 21 and less than 23, that is why I changed to 23cm and works for me.
In my case I have only one page and I was working with .rdl file.