Dynamic text in master page of Birt report - expression

Can dynamic text be entered into a header or footer of a master page?
I have placed dynamic text into a grid which then sits in the master page footer, this doesn't work and gives error:
ReportDesign (id = 1):
+ Invalid javascript expression: ReferenceError: "row" is not defined. (<inline>#1)
When I test the expression in the footer of the report layout itself this works.
Please see the expression below:
if( BirtComp.lessOrEqual( row["Aggregation"], "1,500.00" )){"user1.jpg"}
else if (BirtComp.greaterThan(row["Aggregation"], "1,500.00")){ "user2.jpg"}

The easiest way to use dynamic text in the master page is as follows:
Optional, but recommended: Create a dataset "MasterPage" which selects the dynamic data that you need.
Create a grid in the page footer (and/or header) of the master page.
Bind the grid to the dataset "MasterPage".
Use dynamic text items and data items inside the grid as you like.
Important:
The grid uses only the first row returned by your dataset.
Thus, it is best practice to create the dataset in such a way that it will return exactly one row.
This means that BIRT aggregation functions won't work here.
If your "MasterPage" dataset is JDBC based, you can of course use SQL aggregation functions like SUM, COUNT etc.
It is not possible to access "the current first record for the current page" this way: The "MasterPage" dataset returns one record for the whole report.

Related

Adding a drop-down menu (data validation) after each row of a query result in Google Sheet

First, here is the link to my sheet:
https://docs.google.com/spreadsheets/d/1067N1SAIwpGkMRBZiUv4JW8yDNkozuGt7Fwh6GW-qvE/edit#gid=1742559851
If you look at the tab called "Selection", I have two columns called "Select". All the data in these tables is collected by a query function, except column "Select". In that column, I need to add Data Validation (a simple Yes or No). I want the Data Validation to be automatically added when a new row is created but the query function instead of having to add or remove it manually every time I make some changed. Data collected by the query function is using the two variables on top of the sheet (minimum rating and global buff).
Just to show the step to apply data validation to your whole column, see the following image. Under Cell Range, the image shows Selection!D5:D99, but this is actually set to Selection!D5:D999, it just is truncated due to the size of the text box.
Let us know if this is what you were looking for, or if I've misunderstood your issue.

download data from website using uipath RPA

I have automated the login and getting to the downloading page where i have some pdf's which i want to download. These pdf's are dynamic ,sometimes there are 10 sometimes 100 ,it changes everyday.i want to download those pdf's .
please find the attached image
Here i want to download the pdf by clicking each elements in column 3(hyperlink highlighted in blue colour) ,the number of rows in the table is dynamic.how can i do it using UIPATH.
From the top of my head, without knowing the application you are working in I see a few different approaches you can try:
Approach 1: Extract table as Data Table
Perhaps you can extract the table as a Data Table, enumerate the rows and find the individual link selectors you then can pass to a click activity.
Approach 2: Dynamically manipulating the selector
Use UIExplorer to find the selector of the link in the third column. Typically the attribute idx is the unique identifier. You can construct your own variable idx and in a while loop increment this variable while passing it to a click-activitys selector: "<your normal selector here someAttr="something" idx="+idx.ToString+"/>
This way, when the click fails with selector not found you will be at the last row of the column and you can exist the while loop.
Approach 3: Using Find Children
Another approach is to use the Find children activity on the column or table to get the children, i.e. the rows. You need to know which filter to use, it is basically the selector.
Find children outputs a IEnumerable<UIElement> you can iterate and pass to a click activity
The shared image is a perfect case of scraping a table from Web page which can be done through UiPath's Data Scraping Wizard, refer this tutorial. This will convert your html table into DataTable. This Data Scraping Wizard will take care of dynamin number of rows as well as the pagination (if exist).
Later, you've to iterate the DataTable (ForEach activity) and hit the link to download PDF files.

Adding tables at run time in Telerik Reporting

I've been reading Telerik's documentation and I'm not sure if this is possible: I'm being asked to add tables to a report at run time, without doing so programmatically. A query is run that fetches hierarchical data, and the report owner would like to add a new table to the report for each member of the topmost parent, so that each topmost parent has their own table, with a text box title on top of the table containing the parent's name, in the following pattern:
TopParent1
[Parent1's table]
TopParent2
[Parent2's table]
...
Does anyone know how I could go about doing that without doing so programmatically? Every example and/or bit of documentation I've seen pertains to programmatically adding tables.
It is possible to add tables to a report at run time, without doing
so programmatically?
R: It's not possible to add table with out saying programmatically : the size of each element , the exact position , etc .. .. ..
HowTo create a 'hierachical' report with conditional display ?
1/. Hierachical Report.
Read the telerik official tutorial on How to: Create a Master-Detail Report Using a SubReport Item
Using the SubReport report item you can display one report within another report. The data for each SubReport can be completely different.
But You can achiev Parent/chield relation by Passing Parameters to a SubReport.
/!\ Caution /!\
Page sections are not related to the report itself, but are relative to the paper or screen. Thus page sections of nested/detail reports are ignored and only the page sections of the main report are visible.
In order to have sections that repeat on every page similar to page sections, consider using an unbound group (no grouping criteria specified) and set the PrintOnEveryPage property of its sections to True. Be aware that you cannot use PageCount and PageNumber global objects in group sections.
2/. Conditional Display
You will need to hide Report if subreport have no result.
If you want the user to choose if he want some sub report.
You can do it by passing parameter from your calling application to your report constructor.
And use Something like a Bitfield or an enum to choose what to display.
And What about a C# controler in the master report code behind ?
public myReportConstructor(int SubreportToDisplay)
{
InitializeComponent();
Hiden_Display(SubreportToDisplay);
}
private void Hiden_Display(int _code)
{
if ((_code & (int)myEnum.InfoClient) != (int)myEnum.InfoClient)
HideNShrink(SUBREPORT_CLIENT);
if ((_code & (int)myEnum.Item) != (int)myEnum.Item)
{
HideNShrink(SUBREPORT_Product.Item1);
HideNShrink(SUBREPORT_Product.ItemTWO);
}
}
private void HideNShrink(ReportItem target)
{// http://www.telerik.com/support/kb/reporting/details/collapse-the-container-when-hiding-child-report-items-
target.Visible = false;
target.Height = Telerik.Reporting.Drawing.Unit.Pixel(1);
}
I use a little trick here in my designer every subreport item is set to public:
private Telerik.Reporting.TextBox textBox17;
public Telerik.Reporting.SubReport SubReport_Client;
public Sub_Client sub_CLI1;
When hidding Client I will use the SubReport_Client.
That is the SubReport item, the container of my SubReport Sub_Client ;
(Yes they name the container and the containt are the same name, thats confusing at First, but it's Vs/Telerik choice)
When hidding a Sub Report That is in an other Sub Report.
I use the ContaintSubReport, Container of the nested-nested SubReport.
like: sub_CLI1.nested-nested_SubReport
I was able to answer my own question as follows:
Create two blank reports.
On the report chosen to use for the detail report, remove the report header and footer.
Add data source and parameter/s to the detail report (in my case, an SQL data source) and set report data source to the data source created here.
Add group to report with the value of groupings set to the top-most result in query bound to report. (Groupings = Fields.Parent)
Create text box with the value set to the field for the top result (textbox1.Value = Fields.Parent) or use data explorer to drag and drop Fields.Parent into the group header.
Create text boxes to mimic table column heads (one text box for each title of the columns) and place them into the group header with the text box containing the topmost result (or Fields.Parent).
Drag or create text fields for the rest of the fields in the query (Fields.Child1, Fields.Child2, Fields.Child3, etc) in the detail section of the report, aligned vertically with their column header. Preview the report--it should contain a table-like structure that repeats on each top result.
Switch to other report.
Add same parameter/s to that report.
Add subreport item to the detail section of that report.
Set subreport report source to Type and report document, then select the name of the detail report (the first one created here).
Set parameter/s for subreport to the same parameter/s used in the subreport.
Using that, I was able to essentially add a table per item in the first column of the query. The report created first serves as a wrapper for the query, and because it's being placed in the other report as a subreport item with the grouping I created, it is allowed to repeat as much as it needs to in order to display all the rows in the query.
I used the Telerik documentation for master-detail reports and report structures for this.

Elements between page breaks after each tabular row in BIRT

I have a report design where I have to display each row of a table in separate pages as header and on each page I need to display separate body. In BIRT, if I set the page break property for table as always, I can see the data on separate pages but I am not able to insert other elements in between these rows. Is it possible?
You have to add multiple Detail rows. In first you'll have what you have recently, in second you can put whatever you like, just treat it as a grid.

jqgrid save xml string inside hidden cell problem

I have 2 grids. in both of them i use loadonce:true .
In the first grid i have a cell with an onblur event which
opens a dialog with the second grid.
after i edit the second grid i want to save as xml it's content and
ascribe it to the row of the first grid (the row witch opened the dialog).
In the end i want to generate an xml from the first grid that will
include the xml I generated before in the second grid.
so what is the best way to implement this?
Thank's In Advance.
Depend on how exactly you implement the scenario which you describe you could has any data in the internal data parameter of jqGrid existing always if one use local datatype or loadonce:true in your case.
Direct accessing to the data parameter per jQuery("#grid_id").getGridParam('data') get your reference to the data array. The data array contain all data of the grid (not only the current displayed page) and the data are not yet placed in the <td> element. So the data are unmodified and could contain for example any XML fragments.
UPDATED: To make you easier to understand what I mean I made the small demo. If you double-click on a row you will see the XML data associated with the row.
The "note" column can be hidden. Because all hidden columns exist in grid as HTML markup I made it visible. You can see the difference what can be saved as grid internal data and what can be displayed (also as hidden data).
UPDATED 2: You can consider to use autoencode:true option in your grids.

Resources