Show different header on first page of RTF template (BI publisher) - reporting

I came across a problem while creating RTF template for BI publisher. I am displaying a table in the header (not an MS word header but header identified as something above start:body tag) of an RTF template. That table has 3 rows, I need to display one of those rows only in the first page and not in other pages.
I did not find any method on querying for the page number. So, I used a flag in the following manner: (Here, suffix _f denotes RTF field). The following is what my RTF file looks like:
+---------------------------------------------------------------------------------+
¦ init_f ¦ Row to be shown on all the pages ¦ ¦
¦--------+-----------------------------------------+------------------------------¦
¦ if_f ¦ Row to be shown on the first page only. ¦ end_if_f change_variable_f ¦
+---------------------------------------------------------------------------------+
<?start:body?>
other stuff
<?end body?>
Where,
init_f
<?if: (xdoxslt:get_variable($_XDOCTX,'FLAG')!='NONFIRST')?><?xdoxslt:set_variable($_XDOCTX,'FLAG','FIRST')?><?end if?>
if_f
<?if: (xdoxslt:get_variable($_XDOCTX,'FLAG'))='FIRST'?>
end_if_f
<?end if?>
change_variable_f
<?xdoxslt:set_variable($_XDOCTX,'FLAG','NONFIRST')?>
BUT, I still see all the rows in all the pages. It seems like the value of variable 'FLAG' is not preserved between different pages. To me, it seems like, header is generated once and same header is used in all the pages. What is the solution?

Create different template and call them as follow
<?call-template:tHEADER_VERSO?>
<?start:body?>
<?call-template:tHEADER_RECTO?>
<?for-each#section:XMLELEMENT?>
<?call-template:tDETAILS?>
<?end for-each?>
<?end body?>
<?call-template:tFOOTER?>
To define a template
<?template:tDetail?>
text content
<?end template?>

Related

Separate front-end and back-end views in Laravel

This is how I want my resources folder structure should look like
resource
--------- admin
-------------- views
-------------- layouts
--------- front
-------------- views
-------------- layouts
How can I achieve this in Laravel?
You can create 2 layout.blade.php file one for admin side and one for frontend side.
This approach is wrong you can set multiple custom view directories but the problem lies when you have same-named blade file in multiple directories.
config/view.php
'paths' => [
resource_path('admin'),
resource_path('front'),
],
Directory Structure
resources
--admin
----layouts
----admin.blade.php
--front
----layouts
----front.blade.php
Access in controller e.g.
view('admin'); // This will return admin/admin.blade.php view
Note: these directories should not have same-named files.
The correct way is don't set multiple view directories to make directory structure like this
resources
--views
----admin
------layouts
------index.blade.php
----front
------layouts
------index.blade.php

Is it possible to use two or more repeating groups (not nestead) on same page in PDF template. BI Publisher

fProcessor.process() method stuck when PDF template with two repeating groups on same page is used.
Is it possible to use two or more repeating groups (not nested) on same page?
FormProcessor fProcessor = new FormProcessor();
fProcessor.setTemplate(args[0]); // Input File (PDF) name
fProcessor.setData(args[1]); // Input XML data file name
fProcessor.setOutput(args[2]); // Output File (PDF) name
fProcessor.process();
Received following reply from oracle support
PDF templates do not support multiple nor nested loops.
You can only use one.

Add posts to Jekyll index page, without .md files

I would like to write a generator plugin to add some post-like items to my blog. The items are supposed to appear in the blog index, but they have no page associated to them (you can't click on them).
I know I need something like
class QuoteGenerator < Generator
safe true
def generate(site)
# add a single post
site.posts << QuotePost.new(site, site.source, "Blub")
end
end
But what I don't understand is how to implement my Post subclass. I've found that other plugins (like this one to embed Flickr photos) write the data they want to a markdown+YAML file, and then reference this file:
class QuotePost < Post
def initialize(site, base, title)
# Nooo, I don't want to create a .md file for this
name = "2016-05-13-test.md"
dir = ""
# (write out .md file here)
super(site, base, dir, name)
end
end
But then, I would hardly need a Plugin in the first place. I could just generate the markdown files myself (with an external script).
What I'd like to do is to just set a couple of variables in my Post subclass, and have them available in the template for the blog index. How can I do that?
The case you've described looks to be unrelated to Post, since usual posts are file-based. Collections may be suitable, but again - that's not clear how you getting the content.
I'd suggest two major options:
Use _data/ to set an object list, where each item has the required properties if you can define them via a static JSON/CSV/etc file (or generate it once, to separate external data producer and jekyll visualization).
Use :pre_render hook and a plugin if you have to define the data via code -
your hook will also receive a payload hash as a second parameter which allows you full control over the variables that are available while rendering
Having your data in site.data variable allows you to iterate through items, render something or include a template and so on. Also there are plugins which generate new pages based on site's data.
The right answer depends on how you're getting the content, which markup you need and how those items will be used.

Laravel- displaying partial using different scopes on the same page

I'm building my first project in laravel and I have an index page where I want to show 4 different lists (they're different categories of the same data, and users will have permissions to see one or more of the lists)
The format for the lists (name, link, image, etc) is identical so I made a partial for it, with the idea that on this index page I'd check the authenticated user and if they have permission for list A then show it, if they have permission for list B then show it, etc.
To try it out, I made a scope for the first category (in my controller), and it shows the right data when I pass it to a totally separate view. But I'm unclear on how/whether I can display the partial multiple times on the index view with a different scope each time. What's the right way to go about this?
I imagined I would do something like check the permissions one at a time, make a variable with just that scope of data, and show the partial for just that data, like:
#include ('partials._items_list') , $category_A)
But the comment here suggests that a view has only one scope of data at a time (so maybe my idea isn't a valid thing):
Laravel - Modify and return variable from #include
You can pass different values with the same partial using something like the following:
#include ('partials._items_list') , ['categoey_A' => $category_A]);
#include ('partials._items_list') , ['categoey_A' => $category_B]); // <-- Different Value
Use only {{ $categoey_A }} in your partials._items_list view but output will be different.

CodeIgniter 2 not allowing multiple level subfolders for controllers

As I read the doc, controllers in CodeIgniter are supposed to support multiple level subfolders, but as far as I have tested, it is impossible to work after first a first level folder.
By example:
mysite.dev/ (index page, default controller home.php, works)
mysite.dev/admin/ (admin section, in admin/home.php, works)
mysite.dev/admin/manage/ (in admin/manage/home.php, do not work)
I am trying to know why and how to make it work on multiple level sub folders?
Thanks in advance!
CI only allows one sub-dir level. However, you can emulate this pattern with routes file as #Brendan says:
Controllers:
welcome.php
admin/admin.php
admin/manage.php
Routes file:
$route['admin/manage/:any'] = "admin/manage/$1";
$route['admin/admin'] = 'admin/home.php';
You can implement some changes to the hardcode to get works as expected: http://codeigniter.com/forums/viewthread/190563/

Resources