Reporting services 2005: Is there a way to dymanically change a report header? - sql-server

I have a report that needs different header text on pages depending on the content of the page. Is there a way change the text in the header based on a piece of information on a page?
Page 1 header: ITINERARY
Page 2 header: ITINERARY
Page 3 header: FARE RULES
Page 4 header: RECEIPT
The other issue is that each section of information may be one or more pages long.
At the moment I've had to set out my report spacing out the pages and putting a dummy header at the start of each section.
What is the best way to do this?

Melissa,
You might be able to dynamically render the header content by using the Expression part of the header. Your logic might go something like this:
If ReportItems!Textvalue = "this", do "that"
When I mean the Expression part, right click on the textbox (assuming that's what you're using in the header) and change the expression from there. You also might want to look at the IIF (Immediate If) function too.
For example:
Dim i As Integer = 0
IIf(i = 0, "I am zero", "I am not zero")
Hopefully that should get you in the right direction as I employed a similar situation with Reporting Services last year.
coson

Maybe you can find some info here: http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html (scroll down to see more header-related links)
Or is this what you are looking for? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

What you could do is create each report section in its own separate report, then create a "Master" report that has all of the other reports as sub reports. Then all you'd have to do is put the headers on the master page.

Related

AngularJS - highlight text of an existing pdf file in frontend/Browser

I have found the library
PDF creation
With this library it is possible to create different styles of pdf documents.
My question would be if there is a possibility to mark text (and maybe add a link to this marked text) of an existing pdf file with AngularJS?
Or is there any workaround to do this?
The question is a bit too broad as is - not sure what you mean by "mark" - do you mean highlighted in some way or actually selected?
Anyhow, firstly to get to the correct page -- you can use fragment identifiers in hyperlinks to link to a specific page in a PDF via the page parameter. e.g.
page 1
page 2
If you want to highlight a specific section of a page, via a hyperlink, you can use the highlight parameter, note you must also set the page to use the highlight parameter. e.g.
page 1 - highlight
The rectangle values are integers in a coordinate system where 0,0 represents the top left, and the values are given in the order lt, rt, top, btm.
One can also open a PDF file to a "Named Destination", that is a named section in the document via the nameddest parameter. e.g.
my section
This is great as it doesn't matter if pages are inserted, removed etc as the section will always be correctly linked.
You can read about Named Destinations here and also the various Parameters for Opening PDF Files

How to specify path to a report from another report?

I have SSRS on SQL Server 2012 and using report builder to build a drillthrough report. I have a table 6 rows and multiple columns. Each text box has some number in it and I should be able to click on these numbers and go to a different report. Both these reports would be under same folder on report server.
Problem:
I am able to do it until this point by following instructions at this page.
My problem is I can't use a static link as each text box should direct to it's own unique report. And when I "Specify a report:" using "Browse" button there or by providing static link, same link will be used for all the text boxes in the same column. What I need is to be able to specify path to the report which is of format /Folder_Name/<valueOfColumn1><valueOfColumn2><nameOfColumn3>;
What I tried:
So I tried to use "Expression" by clicking on "fx" button and provided link as =Globals!ReportFolderFields!column1.ValueFields!column2.ValueFields!column3.Name
Outcome:
When I try using above methods by using expression it doesn't throw any error but the text box is not clickable (doesn't turn pointer into an index finger). When I used static link by using "Browse" button, the same text box was clickable and was taking me to another report.
What am I missing here? Any pointer would be helpful.
The syntax of the field list in your formula needs a few changes. It looks like what you're really trying to do is concatenate several fields together, with a slash at several spots, in order to get the proper URL format.
Let's assume that the following elements resolve to the strings you need. (It can sometimes be helpful to verify these resolve to what you're expecting by inserting textboxes for each, individually, in a section of the report for troubleshooting; you can always remove them later.)
Globals!ReportFolder
Fields!column1.Value
Fields!column2.Value
Fields!column3.Name
If you would like to concatenate these together to use as a URL, together with a few slashes added in the correct places, you'll need to follow the SSRS conventions on operators in expressions, which results in something like this:
"/" & Globals!ReportFolder & "/" & Fields!column1.Value & Fields!column2.Value & Fields!column3.Name
as always, since this is an expression, it will need to start with an equals sign.
The expression builder doesn't insert operators for you between fields - it's not that smart...

search results and pagination wrong if embedded view or block in result set

I have two content types (in a Drupal 7.20 environment) which embed views or blocks. When I allow those content types in search results, the results page goes sideways whenever those content types are represented in the result set: the pager shows a different number of total pages from one results page to the next, or disappears entirely after I hit Next (!), fewer than 10 results show per page (yet there's a pager...), etc., etc.
If I disallow those content types (via Custom Search), I don't see any problems with pagination, etc.
What I have noticed is that the actual views/blocks get executed when the search results page is constructed - it's not merely a matter of hits being found in the search_index table.
Anybody know how to address this problem?
(I've searched through stackoverflow, and issues for Search and Custom Search on Drupal.org - no joy.)
Thanks in advance,
Lee
[Edit: fixed a couple of typos...]
[3/17/13 Edit: The problem turns out to be due to the pager for the view or block that is included in the search result set. If the view is in the result set, but doesn't have a pager, there is no problem. My solution, therefore, is to detect that I'm on a search results page in hook_views_query_alter() (by looking at the request URI) and set
$view->items_per_page = 0;
which effectively gets rid of the view's pager.
[I didn't realize I could answer my question - not sure how that's different from editing the question to include the answer, but I'll put my answer here as well, anyway.]
The problem turns out to be due to the pager for the view or block that is included in the search result set. If the view is in the result set, but doesn't have a pager, there is no problem. My solution, therefore, is to detect that I'm on a search results page in hook_views_query_alter() (by looking at the request URI) and set
$view->items_per_page = 0;
which effectively gets rid of the view's pager.

Can't print report header in every page in classic report

how to print report header in every page in Classic report in Nav 2009. I try to see section property (PrintOnEveryPage = yes) . Do you have any idea ?
The only suggestions I can offer with the current details provided is that you ensure PrintOnEveryPage is set to yes (Shift + F4 while selecting a Header section).
Apart from that, ensure that your have your header on a DataItem such as PageLoop vs another DataItem that may not be run on every page. PageLoop Header examples are found through all sorts of NAV repotrs e.g. 206 Sales Invoice.

How to add a custom field into template.php using Zen sub theme

First time poster here, I'm a designer not skilled at all with php and I have a small issue I don't seem to be able to solve. I'm making a site in drupal 7 using a sub theme on zen.
Btw this is a great CMS, even though people say it's really more a developers CMS. I have no trouble to do what I need using views, rules, display suite etc. So a big thank you for all the developers out there making this such a good CMS. But for this apparently simple problem... no module will help me (I think) and I'm kinda stuck.
So here it is: I'd like to add a subtitle next to the title in all my pages.
So what I did was to add a custom field into the content type basic page (machine name: field_sub_title) which is a simple text field.
I uncommented the following line in my template.php
function mytheme_preprocess_page(&$variables, $hook) {
$variables['sub_title'] = t('field_sub_title');
}
Now my question is how do I load the content of my custom field into that variable?
I know i need to change the second part, but I don't have a clue as into what I need to change this.
Displaying the variable into the the page.tpl.php is something I know about so I only need help with the first part.
{EDIT}
Ok I found how to do this :)
I was looking for a solution in the wrong place. I don't need to change any thing in the template.php file.
Just needed to add this bit of code into my page.tpl.php:
<?php
print $node->field_sub_title['und'][0]['value'];
?>
So I'm posting this here for other Drupal newbies struggling with this....
Your solution may work for now, but there may be a more Drupal-y way to handle a problem like this. If you haven't noticed any problems yet, you may find one or more of the following issues down the road:
Someone who doesn't know php or Drupal theming may need to change the way this works.
If you're like me, you may forget where exactly in code this was implemented.
You may see superfluous markup and/or errors on nodes (content) that do not have this sub-title field (ie. event content not having a sub-title field while basic pages and news articles do).
When you add a field to a content type, it will automatically appear anytime content in that content type is displayed. You should be able to add the sub-title field for your page, event or whatever else you need and have it automatically appear in the markup.
You can 'manage display' of a content type to drag and drop the order for fields to appear. You could take it a step further by using a module like Display Suite to add formatting or layout per-content type.
If you feel like this isn't good enough and the markup for the subtitle must be at the same level as the page title (which is rare), at least add an if statement to make your code check to see if the variable is present before trying to print it. I'd also add a new variable and comments for code readability.
<?php
$subtitle = $node->field_sub_title['und'][0]['value'];
if($subtitle){
print $subtitle;
}
?>
Consider using field_get_items or field_view_value, or at least use the LANGUAGE_NONE constant instead of 'und'
See https://api.drupal.org/api/drupal/modules%21field%21field.module/function/field_get_items/7 and https://api.drupal.org/api/drupal/modules!field!field.module/function/field_view_value/7
This has the added benefit of reducing the number of potential security holes you create.

Resources