Dynamically show/hide group footer in Access 2010 report - ms-access

Is there any way to hide a group footer based on a piece of information in the group header or detail? I only want to hide it for some records, not the entire report.
For instance, if I have a report of media types, I want to show a disclaimer "*Melts after prolonged exposure to sunlight" in the footer of any vinyl records, but not in the footer for compact disks.

I put an if-then into the GroupHeader_Format event like this:
If media_type = "vinyl" Then
GroupFooter.Visible = True
Else
GroupFooter.Visible = False
End If

Related

SSRS report tables mutiple lines not showing

I am doing Microsoft Dynmics D365 report layout. I have a table in my report that need to show the lines from the table in MS Dynamic D365. Which have only 2 lines.
D365 frontend system:
In the report layout, it is only showing the first line and the second line is not showing.
Report layout first line only showing:
I want the 2 lines to be showed in the report. I am not sure if my coding is not right or the row group that I am grouping in the report design. Please help me please. Apperciated.
here is my code in the dp class to get the table lines:
PurchPurchaseOrderTmp.MGAItemLabelName = PurchExtendedMaster.ExtName;
PurchPurchaseOrderTmp.MGAColValue1 = PurchExtended.ColValue1;
PurchPurchaseOrderTmp.MGAColValue2 = PurchExtended.ColValue2;
PurchPurchaseOrderTmp.MGAColValue3 = PurchExtended.ColValue3;
PurchPurchaseOrderTmp.MGAColValue4 = PurchExtended.ColValue4;
PurchPurchaseOrderTmp.MGALabelId = PurchExtended.LabelId;
//PurchPurchaseOrderTmp.MGALabelIdString += int2Str(PurchExtended.LabelVersion);
if (PurchPurchaseOrderTmp.MGAItemLabelName != "") {
PurchPurchaseOrderTmp.MGALabelIdString = strFmt("%1-%2",
PurchExtended.LabelId, int2Str(PurchExtended.LabelVersion));
}
else {
PurchPurchaseOrderTmp.MGALabelIdString = "";
}
Here is my report design row grouping:
Thanks
This is not really an answer at the moment as I can't see enough to be certain but...
Looking at the report design, it 'appears' that you don't have anything in the details row(s). The details group rows have been reduced in height so I'm guessing there is nothing in there.
That means that the text boxes below this must be in a group header or footer which is why they will only appear once.
The best way to get your head round this is to dump all the data from your dataset into a simple flat table, then see what you want repeating.
For exmaple, it looks like Label ID (MGAItemLabelName ?) should only be shown once, so there needs to be a group for that - which it looks like you have.
Then within that label name group, you have two rows of data that you want to show, so these must be at a lower level than their parent group. That might be the details row group, or another row group between the header and details depending on your needs.
The details row group typically contains fields that you want to show every instance of and that does not have any subordinate/child data.

SSRS Repeating certain groups and pages

I'm struggling with a problem in SSRS. I have created a customer invoice that is looking good in report viewer however, it needs to be set to print in a certain way.
There are 4 main elements to this report.
Header, this needs to repeat on every other page if the invoice details + footer do not fit on the first page.
Invoice details, this needs to repeat on every other page if the invoice details and footer do not fit on the first page.
Footer, this needs to repeat on every other page if the invoice details and footer do not fit on the first page.
Back of page (payment details, like a bank statement), this needs to repeat on every other page without the header, invoice details or footer.
Is this even possible? If not, the end user has accepted that the first 3 parts of the invoice to repeat as necessary and just the last page to be the payment details.
Thanks in advance
Getting the Report Header and Footer to repeat on every page should be pretty straight forward.
Now if you have some additional information outside of the report content you wish to repeat on every page you could do the following:
As you are probably already aware, when using a Tablix it's possible to repeat table header rows on each page . This can be used to our advantage by adding Tablix with a single column and making it span the size of the page, in both the header and data rows you add rectangles so it acts like the report body. In the header row you can add any data/text you wish to repeat on the next pages.
Now as you want the back-side of the pages to have text on them, you probably don't want this to repeat on every page. Because the back of the pages is always the same static data, you could simply generate your report the way it's set up right now and insert the static page between the pages of the report.
To achive the last part you could use some code like this:
String inputFilePath1 = #""; //back of page
String inputFilePath2 = #""; //report
String outPutFilePath = #""; //final report
PDFDocument doc1 = new PDFDocument(inputFilePath1);
PDFDocument doc2 = new PDFDocument(inputFilePath2);
// Get a page from the first document. -> back of page
PDFPage page = (PDFPage)doc1.GetPage(0);
for(int i = 1; i <= doc2.PageCount; i++)
{
if (i % 2 == 1)
{
// Insert the page to the second document at specified position.
doc2.InsertPage(page, i);
}
}
// Output the new document.
doc2.Save(outPutFilePath)

SSRS report total fields

How to show the total of each page in SSRS report. What I exactly mean is if pageNumber = 1 total should be sum of amount on page 1, if pageNumber = 2 total should be sum of amount of page 2 + total from page 1, etc...
.Have you tried using the running value function?
See https://msdn.microsoft.com/en-us/library/ms159136.aspx
You can also use ReportItems![CellName] to enable you to display the value in the report footer if required.
If this does not give what you require and you have a fixed page size eg A4 you can calculate the page totals and Page Numbers as a fields in your data set. This is more powerfull in settings where for example you want to print a set of customer statements in a single print run. Each customer statement would need its own page numbers and totals. Again you can use ReportItems to display these values in the relevant part of the report as they would appear at the detail level of the dataset. In this case you add a hidden field(s) containing the values you require on the detail line and pick them up using ReportItems. You can also force a page break at the end of each Page number group
To repeat the report Header / Footer on each page see this link
http://bhushan.extreme-advice.com/repeat-table-header-on-each-page-in-ssrs/.
To start with go to the footer properties and make sure repeat on first and last page is checked.

SSRS footer data based on groups

I have this report which has a group based on a field "DeliveryNumber".
It works fine, after every new DeliveryNumber the report shows new data.
But now I want to do the same with the page footer. On every group the footer should show data belonging to just that deliverynumber.
Is this possible, how to achieve this?
Assuming that you want to show Delivery number in the page footer and you have only one Delivery Number per page(i.e. there is page break after every delivery number) then in page footer you can use =ReportItems!Textbox1.Value. (Textbox1 in the expression is going to change, replace it with the textbox name in which you will keep the group header, that is Delivery Number field)
I hope this helps!

MS Access Force report footer to bottom of page

I am trying to make a report for a proposal. I would like to keep a professional look and always force the terms section to the bottom of the page. I could use the page footer but I only want the terms to show on the last page.
My idea is somehow with VBA to set the height of a dummy group such that it forces the report footer to the bottom. The problem is that you can't explicitly set the height of a section.
Anyone else out there with another idea (That works)? :-)
Thanks, Jeff
Here's an idea:
http://bytes.com/topic/misc/answers/499733-report-footer-location-problem#post1939746
To accomodate single page reports you could do something like
If Me.Pages > 0 Then
Me.Section(4).Visible = (iif(Me.Pages = 1, True, Me.Page = Me.Pages))
EndIf
Note that Access only calculates the number of pages if you have page numbers on your report. If you don't want them displayed you can set their Visible property to False.
This did the trick for me:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
Me.PageFooterSection.Visible = (Me.txtPage <> Me.txtPages)
End Sub
Thanks for your help.